summaryrefslogtreecommitdiffstats
path: root/bin/addproject
diff options
context:
space:
mode:
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}" \