diff --git a/bin/publish-site b/bin/publish-site index 024c64f3..927309e4 100755 --- a/bin/publish-site +++ b/bin/publish-site @@ -21,6 +21,7 @@ fi case "$BRANCH" in issues/*) VERSION="${BRANCH#issues/}" + TAGS="$VERSION" ;; *) if echo "$BRANCH" | grep -qE '^[0-9]+\.[0-9]+' ; then @@ -28,12 +29,18 @@ case "$BRANCH" in 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="$VERSION latest" else VERSION="$BRANCH" + TAGS="$VERSION" fi ;; esac -echo ">>> Publishing $PRODUCT $VERSION site to $1" - -wordepress --url "$1" --user "$2" --password "$3" --product "$PRODUCT" --version "$VERSION" publish site +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 eb81a722..f5d2c147 100644 --- a/circle.yml +++ b/circle.yml @@ -62,17 +62,17 @@ deployment: - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS - cd $SRCDIR; make clean-bin - cd $SRCDIR; make publish - - go get github.com/weaveworks/wordepress && cd /home/ubuntu/src/github.com/weaveworks/wordepress && git checkout master && cd cmd/wordepress && go get + - 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" issues: branch: /issues\/.*/ owner: weaveworks commands: - - go get github.com/weaveworks/wordepress && cd /home/ubuntu/src/github.com/weaveworks/wordepress && git checkout master && cd cmd/wordepress && go get + - 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" release: branch: /[0-9]+\.[0-9]+/ owner: weaveworks commands: - - go get github.com/weaveworks/wordepress && cd /home/ubuntu/src/github.com/weaveworks/wordepress && git checkout v0.1.0 && cd cmd/wordepress && go get + - 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_LIVE_URL" "$WP_LIVE_USER" "$WP_LIVE_PASSWORD"