Updating gogs

This commit is contained in:
Bob Mottram 2015-12-15 10:23:46 +00:00
parent 65268030bf
commit d02837b532
1 changed files with 6 additions and 1 deletions

View File

@ -6113,6 +6113,8 @@ function install_gogs {
return return
fi fi
export GOPATH=/home/git/go
# update to the next commit # update to the next commit
if [ -d /var/www/$GIT_DOMAIN_NAME/htdocs ]; then if [ -d /var/www/$GIT_DOMAIN_NAME/htdocs ]; then
if grep -q "Gogs commit" $COMPLETION_FILE; then if grep -q "Gogs commit" $COMPLETION_FILE; then
@ -6125,6 +6127,10 @@ function install_gogs {
git checkout $GOGS_COMMIT -b $GOGS_COMMIT git checkout $GOGS_COMMIT -b $GOGS_COMMIT
sed -i "s/Gogs commit.*/Gogs commit:$GOGS_COMMIT/g" $COMPLETION_FILE sed -i "s/Gogs commit.*/Gogs commit:$GOGS_COMMIT/g" $COMPLETION_FILE
chown -R www-data:www-data /var/www/$GIT_DOMAIN_NAME/htdocs chown -R www-data:www-data /var/www/$GIT_DOMAIN_NAME/htdocs
cd $GOPATH/src/github.com/gogits/gogs
go get -u ./...
go build
systemctl restart gogs
fi fi
else else
echo "Gogs commit:$GOGS_COMMIT" >> $COMPLETION_FILE echo "Gogs commit:$GOGS_COMMIT" >> $COMPLETION_FILE
@ -6147,7 +6153,6 @@ function install_gogs {
echo 'systemctl set-environment GOPATH=/home/git/go' >> ~/.bashrc echo 'systemctl set-environment GOPATH=/home/git/go' >> ~/.bashrc
fi fi
. ~/.bashrc . ~/.bashrc
export GOPATH=/home/git/go
if [ ! -d $GOPATH ]; then if [ ! -d $GOPATH ]; then
mkdir -p $GOPATH mkdir -p $GOPATH
fi fi