Commit 3d713b76 authored by Lukas Matt's avatar Lukas Matt

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
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 [ "$(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
wd=$repo/vendor/github.com/ganggo/federation
rm -r $wd && git clone $PRREPO $wd \
&& cd $wd \
&& git checkout $PRSHA \
&& git log -1 || {
echo "Cannot checkout $PRREPO $PRSHA"
exit 1
}
repo=$repo/vendor/github.com/ganggo/federation
# go-dep prunes git-directory from vendor folder
rm -r $repo && git clone \
https://github.com/ganggo/federation.git $repo
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
sed -i "s/NAME/$DATABASE/g" $repo/conf/app.conf \
&& sed -i "s/PORT/$PORT/g" $repo/conf/app.conf \
&& revel run github.com/ganggo/ganggo
# start the application server
revel run github.com/ganggo/ganggo
#!/bin/bash
repo=/socialhome
if [ "$PROJECT" == "socialhome" ]; then
if [ "$(basename $PRREPO)" == "socialhome.git" ]; then
cd /socialhome \
&& git remote add custom $PRREPO \
&& git fetch custom \
&& git checkout $PRSHA \
&& git log -1 || {
echo "Cannot find $PRREPO $PRSHA"
exit 1
}
if [ "$(basename $PRREPO)" == "federation.git" ]; then
repo=$repo/src/federation
rm -r $repo && git clone \
https://github.com/jaywink/federation.git $repo
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
cd /socialhome \
&& pip-sync dev-requirements.txt \
&& npm install \
&& manage.py migrate \
&& 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
# 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