Extract shared function

This commit is contained in:
Adam Harrison committed 2016-09-29 11:45:28 +01:00
1 parent e1063944f6
commit 263dffeedc
4 files changed
+22 -19

No files matched your search

+7 -9
View File
@@ -3,17 +3,10 @@
set -e
set -o pipefail
source "$(dirname "$(readlink -f "$0")")/circle-functions"
source "$STATE"
go get github.com/weaveworks/wordepress
cd /home/ubuntu/src/github.com/weaveworks/wordepress
git checkout v1.0.0
cd cmd/wordepress
go get
cd $SRCDIR
bin/publish-site "$WP_DEV_URL" "$WP_DEV_USER" "$WP_DEV_PASSWORD"
site_changes() {
curl -s https://api.github.com/repos/weaveworks/weave/pulls/$1/files |
jq -r '.[]|.status + " " + .filename' |
@@ -40,6 +33,11 @@ post_comment() {
https://api.github.com/repos/weaveworks/weave/issues/$GH_PR/comments > /dev/null
}
install_wordepress v1.0.0
cd $SRCDIR
bin/publish-site "$WP_DEV_URL" "$WP_DEV_USER" "$WP_DEV_PASSWORD"
if [ -n "$WP_GH_COMMENT_TOKEN" -a -n "$GH_PR" ] ; then
echo ">>> Adding doc changelog to GitHub PR $GH_PR"
if CHANGES=$(site_changes $GH_PR) && [ -n "$CHANGES" ] ; then
+3 -5
View File
@@ -2,6 +2,8 @@
set -e
source "$(dirname "$(readlink -f "$0")")/circle-functions"
source "$STATE"
if [ -z "$SKIP_TESTS" ] ; then
@@ -11,11 +13,7 @@ if [ -z "$SKIP_TESTS" ] ; then
make publish
fi
go get github.com/weaveworks/wordepress
cd /home/ubuntu/src/github.com/weaveworks/wordepress
git checkout v1.0.0
cd cmd/wordepress
go get
install_wordepress v1.0.0
cd $SRCDIR
bin/publish-site "$WP_DEV_URL" "$WP_DEV_USER" "$WP_DEV_PASSWORD"
+3 -5
View File
@@ -2,13 +2,11 @@
set -e
source "$(dirname "$(readlink -f "$0")")/circle-functions"
source "$STATE"
go get github.com/weaveworks/wordepress
cd /home/ubuntu/src/github.com/weaveworks/wordepress
git checkout v1.0.0
cd cmd/wordepress
go get
install_wordepress v1.0.0
cd $SRCDIR
bin/publish-site "$WP_LIVE_URL" "$WP_LIVE_USER" "$WP_LIVE_PASSWORD"
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
install_wordepress() {
go get github.com/weaveworks/wordepress
cd /home/ubuntu/src/github.com/weaveworks/wordepress
git checkout $1
cd cmd/wordepress
go get
}