]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
add support for building based on tags/branches
authorDylan William Hardison <dylan@hardison.net>
Mon, 2 Oct 2017 19:45:40 +0000 (15:45 -0400)
committerGitHub <noreply@github.com>
Mon, 2 Oct 2017 19:45:40 +0000 (15:45 -0400)
.circleci/config.yml

index 30bc162c88c80e90659e10695f47cc26f5e3c98c..a6339fdbcdb77ee7c6445397eb0cee50b626d3c5 100644 (file)
@@ -60,15 +60,16 @@ jobs:
           name: install git and ssh
           command: apk update && apk add git openssh-client
       - checkout
-      - run: |
-          docker build -t bmo .
+      - run: docker build -t bmo .
+      - deploy: |
           if [[ -n "$DOCKERHUB_REPO" && -n "$DOCKER_USER" && -n "$DOCKER_PASS" ]]; then
-            TAG="$CIRCLE_BRANCH"
-            if [[ $TAG == "master" ]]; then
-              docker tag bmo $DOCKERHUB_REPO:latest
+              TAG="${CIRCLE_TAG:-$CIRCLE_BRANCH}"
+              if [[ $TAG == "master" ]]; then
+                TAG=latest
+              fi
+              docker tag bmo $DOCKERHUB_REPO:$TAG
               docker login -u "$DOCKER_USER" -p "$DOCKER_PASS"
-              docker push $DOCKERHUB_REPO:latest
-            fi
+              docker push $DOCKERHUB_REPO:$TAG
           fi
 
   test_sanity:
@@ -156,7 +157,7 @@ jobs:
 
 workflows:
   version: 2
-  tests:
+  main:
     jobs:
       - test_sanity
       - test_bmo
@@ -165,6 +166,13 @@ workflows:
       - build:
           requires:
             - test_sanity
-            - test_webservices
-            - test_selenium
-            - test_bmo
+          filters:
+            branches:
+              only:
+                - master
+                - development
+                - production
+            tags:
+              only:
+                - /release-[0-9]{6}\.[0-9]+/
+                - /test-[a-zA-Z0-9_-]+/
\ No newline at end of file