From e54c4259b1199d0826f8a1b9e49fb83889628003 Mon Sep 17 00:00:00 2001 From: Hai Liang Wang Date: Thu, 15 Jun 2023 13:36:54 +0800 Subject: [PATCH] https://github.com/cskefu/cskefu/issues/830 dockerize set filters --- .circleci/config.yml | 26 ++++++++++++-------------- contact-center/admin/build.sh | 2 ++ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 59b3bf2d..4cc2c2ec 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ version: 2.1 # See: https://circleci.com/docs/configuration-reference/#jobs jobs: # Below is the definition of your job to build and test your app, you can rename and customize it as you want. - package: + package-build-push: # These next lines define a Docker executor: https://circleci.com/docs/executor-types/ # You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub. # Be sure to update the Docker image tag below to openjdk version of your application. @@ -18,21 +18,17 @@ jobs: steps: # Checkout the code as the first step. - checkout - # Use mvn clean and package as the standard maven build phase - - run: - name: Package - command: cd contact-center && ./admin/package.sh - - publish: - docker: - - image: circleci/buildpack-deps:stretch - steps: - setup_remote_docker - run: - name: Publish Docker Image to Docker Hub + name: Login DockerHub command: | echo "$DOCKERHUB_USERPASS" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin - cd contact-center && ./admin/build.sh && ./admin/push.sh + - run: + name: Build Contact Center Docker Image + command: cd $CIRCLE_WORKING_DIRECTORY/contact-center && ./admin/build.sh + - run: + name: Push Contact Center Docker Image to DockerHub + command: cd $CIRCLE_WORKING_DIRECTORY/contact-center && ./admin/push.sh # Invoke jobs via workflows # See: https://circleci.com/docs/configuration-reference/#workflows @@ -40,5 +36,7 @@ workflows: dockerize: # This is the name of the workflow, feel free to change it to better match your workflow. # Inside the workflow, you define the jobs you want to run. jobs: - - package - - publish + - package-build-push: + filters: + branches: + only: develop \ No newline at end of file diff --git a/contact-center/admin/build.sh b/contact-center/admin/build.sh index 1074e0d1..cd9b7804 100755 --- a/contact-center/admin/build.sh +++ b/contact-center/admin/build.sh @@ -19,6 +19,8 @@ TIMESTAMP=`date "+%Y%m%d.%H%M%S"` PACKAGE_VERSION=`git rev-parse --short HEAD` APPLICATION_CUSTOMER_ENTITY=${APPLICATION_CUSTOMER_ENTITY:-"OpenSource Community"} +$baseDir/package.sh + if [ ! $? -eq 0 ]; then exit 1 fi