Commit 3d713b76 authored by zauberstuhl's avatar zauberstuhl

Merge PR's to target branch instead of using PR head

ganggo && socialhome

* Install new dependencies and assets on custom build
* Clone federation vendor repo before merging

fixes #14
parent 297f034e
#!/bin/bash #!/bin/bash
repo=$GOPATH/src/github.com/ganggo/ganggo repo=$GOPATH/src/github.com/ganggo/ganggo
# parse and replace configuration values
sed -i "s/NAME/$DATABASE/g" $repo/conf/app.conf \
&& sed -i "s/PORT/$PORT/g" $repo/conf/app.conf
if [ "$PROJECT" == "ganggo" ]; then if [ "$PROJECT" == "ganggo" ]; then
if [ "$(basename $PRREPO)" == "ganggo.git" ]; then
cd $repo && git stash \
&& git remote add custom $PRREPO \
&& git fetch custom \
&& git checkout $PRSHA \
&& git log -1 || {
echo "Cannot find $PRREPO $PRSHA"
exit 1
}
fi
if [ "$(basename $PRREPO)" == "federation.git" ]; then if [ "$(basename $PRREPO)" == "federation.git" ]; then
wd=$repo/vendor/github.com/ganggo/federation repo=$repo/vendor/github.com/ganggo/federation
rm -r $wd && git clone $PRREPO $wd \ # go-dep prunes git-directory from vendor folder
&& cd $wd \ rm -r $repo && git clone \
&& git checkout $PRSHA \ https://github.com/ganggo/federation.git $repo
&& git log -1 || {
echo "Cannot checkout $PRREPO $PRSHA"
exit 1
}
fi fi
cd $repo && git stash \
&& git remote add custom $PRREPO \
&& git fetch custom \
&& git merge $PRSHA \
&& git log -1 || {
echo "Cannot find $PRREPO $PRSHA"
exit 1
}
# install new dependencies
# and compile assets
make install precompile
fi fi
sed -i "s/NAME/$DATABASE/g" $repo/conf/app.conf \ # start the application server
&& sed -i "s/PORT/$PORT/g" $repo/conf/app.conf \ revel run github.com/ganggo/ganggo
&& revel run github.com/ganggo/ganggo
#!/bin/bash #!/bin/bash
repo=/socialhome
if [ "$PROJECT" == "socialhome" ]; then if [ "$PROJECT" == "socialhome" ]; then
if [ "$(basename $PRREPO)" == "socialhome.git" ]; then if [ "$(basename $PRREPO)" == "federation.git" ]; then
cd /socialhome \ repo=$repo/src/federation
&& git remote add custom $PRREPO \ rm -r $repo && git clone \
&& git fetch custom \ https://github.com/jaywink/federation.git $repo
&& git checkout $PRSHA \
&& git log -1 || {
echo "Cannot find $PRREPO $PRSHA"
exit 1
}
fi fi
cd $repo && git stash \
&& git remote add custom $PRREPO \
&& git fetch custom \
&& git merge $PRSHA \
&& git log -1 || {
echo "Cannot find $PRREPO $PRSHA"
exit 1
}
# re-install dependencies # re-install dependencies
cd /socialhome \ cd /socialhome \
&& pip-sync dev-requirements.txt \ && pip-sync dev-requirements.txt \
&& npm install \ && npm install \
&& manage.py migrate \ && manage.py migrate \
&& npm run dev && npm run dev
if [ "$(basename $PRREPO)" == "federation.git" ]; then
rm -vr /socialhome/src/federation \
&& git clone $PRREPO /socialhome/src/federation \
&& cd /socialhome/src/federation \
&& git checkout $PRSHA \
&& git log -1 || {
echo "Cannot find $PRREPO $PRSHA"
exit 1
}
fi
fi fi
# NOTE workaround for validating localhost domain name # NOTE workaround for validating localhost domain name
......
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