diff --git a/circle.yml b/circle.yml index e743d662d27f2829f95c27df0f0c5e7f47d6c51b..f2cc9173abdedf6a000600d403a381bc9ab635fe 100644 --- a/circle.yml +++ b/circle.yml @@ -41,15 +41,42 @@ deployment: branch: release-0.12 commands: - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS quay.io + # build docker image and tag the image with the version - tests/build_tool.sh - - "docker tag quay.io/eris/db:build throw:build && docker rmi quay.io/eris/db:build" - docker push quay.io/eris/db - - docs/build.sh release + # push the updated documentation + - docs/build.sh + release-0.16: + branch: release-0.16 + commands: + - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS quay.io + # build docker image and tag the image with the version + - tests/build_tool.sh + - docker push quay.io/eris/db + # push the updated documentation + - docs/build.sh master: branch: master commands: - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS quay.io + # build docker image and tag the image with ':latest' + # builds on master are considered immutable so we do not push the version + # tag to allow for hotfixes + - tests/build_tool.sh latest + - docker push quay.io/eris/db + # push the updated documentation and replace latest + - docs/build.sh latest + tagged-releases: + tag: /v[0-9]+(\.[0-9]+)*/ + commands: + - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS quay.io + # build docker image and tag the image with the version; + # once the commit is tagged the docker image for this version tag is + # considered immutable. - tests/build_tool.sh - - "docker rmi quay.io/eris/db:latest && docker tag quay.io/eris/db:build throw:build && docker rmi quay.io/eris/db:build" - docker push quay.io/eris/db + # push the updated documentation - docs/build.sh + + + diff --git a/docs/build.sh b/docs/build.sh index d2f09724600e3262bcd8d63e9bfc54567cc81144..ac790cbf584c12877fe8596574a18c8c01c2cd33 100755 --- a/docs/build.sh +++ b/docs/build.sh @@ -28,7 +28,7 @@ cd $repo rm -rf $docs_name go run ./docs/generator.go -if [[ "$1" == "release" ]] +if [[ "$1" == "latest" ]] then mkdir -p $docs_name/$slim_name/latest rsync -av $docs_name/$slim_name/$release_min/ $docs_name/$slim_name/latest/ diff --git a/tests/build_tool.sh b/tests/build_tool.sh index 1f377e91eacd659791df20bef4dd87c5d311a215..4c4607d8e844a6fd174adcab42303b912ae375af 100755 --- a/tests/build_tool.sh +++ b/tests/build_tool.sh @@ -41,18 +41,14 @@ docker run --rm --entrypoint cat $IMAGE:build /usr/local/bin/$TARGET > $REPO/tar docker run --rm --entrypoint cat $IMAGE:build /usr/local/bin/eris-client > $REPO/target/docker/eris-client.dockerartefact docker build -t $IMAGE:$release_min -f Dockerfile.deploy $REPO -# Cleanup -rm $REPO/target/docker/eris-db.dockerartefact -rm $REPO/target/docker/eris-client.dockerartefact - -# Extra Tags -if [[ "$branch" = "release" ]] +# If provided, tag the image with the label provided +if [ "$1" ] then - docker tag -f $IMAGE:$release_min $IMAGE:$release_maj - docker tag -f $IMAGE:$release_min $IMAGE:latest + docker tag $IMAGE:$release_min $IMAGE:$1 + docker rmi $IMAGE:$release_min fi -if [ "$CIRCLE_BRANCH" ] -then - docker tag -f $IMAGE:$release_min $IMAGE:latest -fi +# Cleanup +rm $REPO/"$TARGET"_build_artifact +rm $REPO/eris-client +docker rmi $IMAGE:build