From 534dd8e16ab9a2e50a1c8ef806c4a26edf28d969 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Mon, 22 May 2017 14:57:04 +0000 Subject: [PATCH] Stop doing Wordpress previews on Pantheon Now we are using Netlify instead --- bin/circle-deploy-issues | 43 ------------------------------------ bin/circle-deploy-master | 4 ---- bin/circle-deploy-release | 7 ------ bin/install-wordepress | 12 ---------- bin/publish-site | 46 --------------------------------------- circle.yml | 10 --------- 6 files changed, 122 deletions(-) delete mode 100755 bin/circle-deploy-issues delete mode 100755 bin/circle-deploy-release delete mode 100755 bin/install-wordepress delete mode 100755 bin/publish-site diff --git a/bin/circle-deploy-issues b/bin/circle-deploy-issues deleted file mode 100755 index b843731e..00000000 --- a/bin/circle-deploy-issues +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -set -e -set -o pipefail - -source "$STATE" - -site_changes() { - curl -s https://api.github.com/repos/weaveworks/weave/pulls/$1/files | - jq -r '.[]|.status + " " + .filename' | - grep -oP '^(added|modified|removed) site/.*(?=\.md$)' -} - -format_comment() { - if [ ! -d .git ] || ! BRANCH=$(git symbolic-ref --short HEAD) || [ -z "$BRANCH" ] ; then - echo "Could not determine branch" >&2 - return 1 - fi - - echo "#### Documentation changes:" - while read ACTION PAGE; do - echo "$ACTION [${PAGE#site/}]($WP_DEV_URL/docs/net/${BRANCH#issues/}/${PAGE#site/}/)" - done | sort -} - -post_comment() { - jq -s -R '. | tostring | { body: . }' | - curl -s -d @- \ - -H "Authorization: Bearer $WP_GH_COMMENT_TOKEN" \ - -H 'Content-Type: application/json' \ - https://api.github.com/repos/weaveworks/weave/issues/$GH_PR/comments > /dev/null -} - -cd $SRCDIR -bin/install-wordepress dc25407c2d2669366cd5c5b41c166b719f5570d0 -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 - echo "$CHANGES" | format_comment | post_comment - fi -fi diff --git a/bin/circle-deploy-master b/bin/circle-deploy-master index b0449faa..4c0efb56 100755 --- a/bin/circle-deploy-master +++ b/bin/circle-deploy-master @@ -11,7 +11,3 @@ if [ -n "$TEST_AND_PUBLISH" ] ; then # CircleCI doesn't let us install the qemu module to do ARM docker builds make publish ALL_ARCHITECTURES=amd64 UPDATE_LATEST=latest-only fi - -cd $SRCDIR -bin/install-wordepress v1.0.0 -bin/publish-site "$WP_DEV_URL" "$WP_DEV_USER" "$WP_DEV_PASSWORD" diff --git a/bin/circle-deploy-release b/bin/circle-deploy-release deleted file mode 100755 index d7db8d44..00000000 --- a/bin/circle-deploy-release +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -set -e - -cd $SRCDIR -bin/install-wordepress v1.0.0 -bin/publish-site "$WP_LIVE_URL" "$WP_LIVE_USER" "$WP_LIVE_PASSWORD" diff --git a/bin/install-wordepress b/bin/install-wordepress deleted file mode 100755 index 89562d8b..00000000 --- a/bin/install-wordepress +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -if [ $# -ne 1 ] ; then - echo USAGE: install-wordepress [COMMIT-ISH] >&2 - exit 1 -fi - -go get github.com/weaveworks/wordepress -cd /home/ubuntu/src/github.com/weaveworks/wordepress -git checkout $1 -cd cmd/wordepress -go get diff --git a/bin/publish-site b/bin/publish-site deleted file mode 100755 index 4399d43a..00000000 --- a/bin/publish-site +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - -set -e -set -o pipefail - -PRODUCT=net - -fatal() { - echo "$@" >&2 - exit 1 -} - -if [ ! -d .git ] ; then - fatal "Current directory is not a git clone" -fi - -if ! BRANCH=$(git symbolic-ref --short HEAD) || [ -z "$BRANCH" ] ; then - fatal "Could not determine branch" -fi - -case "$BRANCH" in - issues/*) - VERSION="${BRANCH#issues/}" - TAGS="$VERSION" - ;; - *) - if echo "$BRANCH" | grep -qE '^[0-9]+\.[0-9]+' ; then - DESCRIBE=$(git describe --match 'v*') - if ! VERSION=$(echo "$DESCRIBE" | grep -oP '(?<=^v)[0-9]+\.[0-9]+\.[0-9]+') ; then - fatal "Could not infer latest $BRANCH version from $DESCRIBE" - fi - TAGS="latest" - else - VERSION="$BRANCH" - TAGS="$VERSION" - fi - ;; -esac - -for TAG in $TAGS ; do - echo ">>> Publishing $PRODUCT $VERSION to $1/docs/$PRODUCT/$TAG" - wordepress \ - --url "$1" --user "$2" --password "$3" \ - --product "$PRODUCT" --version "$VERSION" --tag "$TAG" \ - publish site -done diff --git a/circle.yml b/circle.yml index d85b5922..7cb13153 100644 --- a/circle.yml +++ b/circle.yml @@ -59,18 +59,8 @@ teardown: parallel: true deployment: - release: - branch: /[0-9]+\.[0-9]+/ - owner: weaveworks - commands: - - "$SRCDIR/bin/circle-deploy-release" master: branch: master owner: weaveworks commands: - "$SRCDIR/bin/circle-deploy-master" - issues: - branch: /.*/ - owner: weaveworks - commands: - - "$SRCDIR/bin/circle-deploy-issues"