Unverified Commit a2bca603 authored by zauberstuhl's avatar zauberstuhl Committed by GitHub
Browse files

Merge pull request #15 from thefederationinfo/merge_target_branch

Merge PR's to target branch instead of using PR head
parents 297f034e 3d713b76
#!/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 if [ "$(basename $PRREPO)" == "federation.git" ]; then
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 \ cd $repo && git stash \
&& git remote add custom $PRREPO \ && git remote add custom $PRREPO \
&& git fetch custom \ && git fetch custom \
&& git checkout $PRSHA \ && git merge $PRSHA \
&& git log -1 || { && git log -1 || {
echo "Cannot find $PRREPO $PRSHA" echo "Cannot find $PRREPO $PRSHA"
exit 1 exit 1
} }
fi
if [ "$(basename $PRREPO)" == "federation.git" ]; then # install new dependencies
wd=$repo/vendor/github.com/ganggo/federation # and compile assets
rm -r $wd && git clone $PRREPO $wd \ make install precompile
&& cd $wd \
&& git checkout $PRSHA \
&& git log -1 || {
echo "Cannot checkout $PRREPO $PRSHA"
exit 1
}
fi
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
rm -r $repo && git clone \
https://github.com/jaywink/federation.git $repo
fi
cd $repo && git stash \
&& git remote add custom $PRREPO \ && git remote add custom $PRREPO \
&& git fetch custom \ && git fetch custom \
&& git checkout $PRSHA \ && git merge $PRSHA \
&& git log -1 || { && git log -1 || {
echo "Cannot find $PRREPO $PRSHA" echo "Cannot find $PRREPO $PRSHA"
exit 1 exit 1
} }
fi
# re-install dependencies # re-install dependencies
cd /socialhome \ cd /socialhome \
...@@ -18,17 +23,6 @@ if [ "$PROJECT" == "socialhome" ]; then ...@@ -18,17 +23,6 @@ if [ "$PROJECT" == "socialhome" ]; then
&& 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