Commit b5b05e79 authored by zauberstuhl's avatar zauberstuhl

Merge branch 'update_ganggo_entrypoint' into 'master'

Update entrypoint in ganggo docker image

See merge request feneas/federation-testsuite!5
parents 11f7491e e6dbd6a0
Pipeline #816 passed with stage
in 6 minutes and 44 seconds
#!/bin/bash #!/bin/bash
repo=$GOPATH/src/git.feneas.org/ganggo/ganggo root=$GOPATH/src/git.feneas.org/ganggo/ganggo
# parse and replace configuration values # parse and replace configuration values
sed -i "s/NAME/$DATABASE/g" $repo/conf/app.conf \ sed -i "s/NAME/$DATABASE/g" $root/conf/app.conf \
&& sed -i "s/PORT/$PORT/g" $repo/conf/app.conf \ && sed -i "s/PORT/$PORT/g" $root/conf/app.conf \
&& sed -i "s/CIP/$(hostname -i)/g" $repo/conf/app.conf || exit 1; && sed -i "s/CIP/$(hostname -i)/g" $root/conf/app.conf || exit 1;
if [ "$PROJECT" == "ganggo" ]; then if [ "$(basename $PRREPO)" == "ganggo.git" ]; then
if [ "$(basename $PRREPO)" == "federation.git" ]; then # Use custom application server
repo=$repo/vendor/git.feneas.org/ganggo/federation git checkout . \
# go-dep prunes git-directory from vendor folder
rm -r $repo && git clone \
https://git.feneas.org/ganggo/federation.git $repo
fi
cd $repo && git checkout . \
&& git remote add custom $PRREPO \ && git remote add custom $PRREPO \
&& git fetch custom \ && git fetch custom \
&& git merge -m merge $PRSHA \ && git merge -m merge $PRSHA \
&& git log -1 || { && git log -1 || {
echo "Cannot find $PRREPO $PRSHA" echo "Cannot pull from repo=$PRREPO sha=$PRSHA"
exit 1 exit 1
} }
else
# Update ganggo application server
git pull origin master && git log -1 || {
echo "Cannot pull from origin"
exit 1
}
fi
# install new dependencies
# and compile assets
make install precompile
dep ensure
# install new dependencies # update federation lib if necessary
# and compile assets if [ "$(basename $PRREPO)" == "federation.git" ]; then
make install precompile repo=$root/vendor/git.feneas.org/ganggo/federation
dep ensure # go-dep prunes git-directory from vendor folder
rm -rf $repo && git clone $PRREPO $repo
cd $repo && git checkout $PRSHA
fi fi
# start the application server # start the application server
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment