gogs path
This commit is contained in:
parent
3030d616ac
commit
16d40a4290
|
@ -6116,18 +6116,16 @@ function install_gogs {
|
||||||
export GOPATH=/home/git/go
|
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 ]; then
|
||||||
if grep -q "Gogs commit" $COMPLETION_FILE; then
|
if grep -q "Gogs commit" $COMPLETION_FILE; then
|
||||||
CURRENT_GOGS_COMMIT=$(grep "Gogs commit" $COMPLETION_FILE | awk -F ':' '{print $2}')
|
CURRENT_GOGS_COMMIT=$(grep "Gogs commit" $COMPLETION_FILE | awk -F ':' '{print $2}')
|
||||||
if [[ "$CURRENT_GOGS_COMMIT" != "$GOGS_COMMIT" ]]; then
|
if [[ "$CURRENT_GOGS_COMMIT" != "$GOGS_COMMIT" ]]; then
|
||||||
cd /var/www/$GIT_DOMAIN_NAME/htdocs
|
cd $GOPATH/src/github.com/gogits/gogs
|
||||||
git stash
|
git stash
|
||||||
git checkout master
|
git checkout master
|
||||||
git pull
|
git pull
|
||||||
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
|
|
||||||
cd $GOPATH/src/github.com/gogits/gogs
|
|
||||||
go get -u ./...
|
go get -u ./...
|
||||||
go build
|
go build
|
||||||
systemctl restart gogs
|
systemctl restart gogs
|
||||||
|
|
Loading…
Reference in New Issue