diff --git a/bin/circle-deploy-issues b/bin/circle-deploy-issues index 8923ade7..0cf6a053 100755 --- a/bin/circle-deploy-issues +++ b/bin/circle-deploy-issues @@ -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 diff --git a/bin/circle-deploy-master b/bin/circle-deploy-master index 2827ad91..14b484cb 100755 --- a/bin/circle-deploy-master +++ b/bin/circle-deploy-master @@ -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" diff --git a/bin/circle-deploy-release b/bin/circle-deploy-release index ce2e9eb5..1e29a2fe 100755 --- a/bin/circle-deploy-release +++ b/bin/circle-deploy-release @@ -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" diff --git a/bin/circle-functions b/bin/circle-functions new file mode 100644 index 00000000..8ed249cd --- /dev/null +++ b/bin/circle-functions @@ -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 +}