Fixing gogs systemd environment

This commit is contained in:
Bob Mottram 2015-04-05 10:33:26 +01:00
parent a5e4a59e14
commit d62015c061
1 changed files with 2 additions and 2 deletions

View File

@ -6808,7 +6808,7 @@ quit" > $INSTALL_DIR/batch.sql
sed -i 's|#After=mysqld.service|After=mysqld.service|g' /etc/systemd/system/gogs.service
sed -i "s|WorkingDirectory=.*|WorkingDirectory=$GOPATH/src/github.com/gogits/gogs|g" /etc/systemd/system/gogs.service
sed -i "s|ExecStart=.*|ExecStart=$GOPATH/src/github.com/gogits/gogs/gogs web|g" /etc/systemd/system/gogs.service
sed -i "s|Environment.*|Environment=\"USER=git\",\"HOME=/home/git\",\"GOPATH=/home/git/go\"|g" /etc/systemd/system/gogs.service
sed -i "s|Environment.*|Environment=\"USER=git\" \"HOME=/home/git\" \"GOPATH=/home/git/go\"|g" /etc/systemd/system/gogs.service
systemctl enable gogs
systemctl daemon-reload
systemctl restart gogs
@ -8463,7 +8463,7 @@ function create_upgrade_script {
echo 'git pull' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'chown -R git:git /home/git' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'chmod 600 /home/git/go/src/github.com/gogits/gogs/custom/conf/app.ini' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'GOPATH=/home/git/go' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'export GOPATH=/home/git/go' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'go build' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'systemctl restart gogs' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'systemctl daemon-reload' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME