summaryrefslogtreecommitdiffstats
path: root/bin/addproject
diff options
context:
space:
mode:
authorroot <root@dev.spline.de>2008-08-28 18:13:33 +0200
committerroot <root@dev.spline.de>2008-08-28 18:13:33 +0200
commit77372fbbf321bc0f4085f5003283e8c6127036bf (patch)
treea023175d4925184b7811594a45778267d15ce0c0 /bin/addproject
parent43cad154aaa7778b51b884b24147b51656ae3596 (diff)
downloaddev-scripts-77372fbbf321bc0f4085f5003283e8c6127036bf.tar.gz
dev-scripts-77372fbbf321bc0f4085f5003283e8c6127036bf.tar.xz
dev-scripts-77372fbbf321bc0f4085f5003283e8c6127036bf.zip
added the index page for the users' trac-wiki and a useful getting started page.
database connection funtion for add/del project add initial project members in addproject to database
Diffstat (limited to 'bin/addproject')
-rwxr-xr-xbin/addproject12
1 files changed, 10 insertions, 2 deletions
diff --git a/bin/addproject b/bin/addproject
index f40e3ae..4ece360 100755
--- a/bin/addproject
+++ b/bin/addproject
@@ -1,7 +1,7 @@
#!/bin/bash
dbquery() {
- mysql -s -s -e "$@" trac
+ mysql -s -s -e "$*" trac
}
# main function
@@ -72,6 +72,8 @@ main() {
done
eexec trac-admin ${trac_home} permission add authenticated TRAC_ADMIN
+ eexec trac-admin ${trac_home} wiki import WikiStart WikiStart.txt
+ eexec trac-admin ${trac_home} wiki import GettingStarted GettingStarted.txt
eheading "setting up apache2"
eexec sed -i -e "\$a\\# ${project_name} (added on $(date -R))\\" ${APACHE_PROJECT_CONF}
@@ -80,7 +82,7 @@ main() {
if [[ ${project_closed} == y ]]
then
eexec sed -i -e "\$a\\Use SVNProjectClosed ${project_name}\\" ${APACHE_PROJECT_CONF}
- else
+ else
eexec sed -i -e "\$a\\Use SVNProject ${project_name}\\" ${APACHE_PROJECT_CONF}
fi
@@ -93,6 +95,12 @@ main() {
eexec git commit -m "added new project ${project_name}"
popd > /dev/null
+ eheading "adding initial project member to the database"
+ eexec dbquery "INSERT INTO project (project_name) VALUES ('${project_name}')"
+ eexec dbquery "INSERT INTO member (user_id, project_id) VALUES (" \
+ "(SELECT id FROM user WHERE login = '${user_name}')," \
+ "(SELECT id FROM project WHERE project_name = '${project_name}'))"
+
eheading "requesting new mailinglist for the project"
# register mailinglist (owner is user_email) for the new project
eexec wget -q -O /dev/null --no-check-certificate --post-data "name=commit-${project_name}&email=${user_email}" \