From 306e06e5b6643f85eaac439e32d22cc2f38502df Mon Sep 17 00:00:00 2001 From: Hai Liang Wang Date: Thu, 15 Jun 2023 13:34:10 +0800 Subject: [PATCH] https://github.com/cskefu/cskefu/issues/830 dockerize build and push --- .circleci/config.yml | 14 +++++++++++++- contact-center/admin/build.sh | 4 +--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3e7f8209..59b3bf2d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,7 +21,18 @@ jobs: # Use mvn clean and package as the standard maven build phase - run: name: Package - command: cd contact-center && ./admin/build.sh + 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 + command: | + echo "$DOCKERHUB_USERPASS" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin + cd contact-center && ./admin/build.sh && ./admin/push.sh # Invoke jobs via workflows # See: https://circleci.com/docs/configuration-reference/#workflows @@ -30,3 +41,4 @@ workflows: # Inside the workflow, you define the jobs you want to run. jobs: - package + - publish diff --git a/contact-center/admin/build.sh b/contact-center/admin/build.sh index bffa6131..1074e0d1 100755 --- a/contact-center/admin/build.sh +++ b/contact-center/admin/build.sh @@ -17,9 +17,7 @@ imagename=cskefu/contact-center cd $appHome TIMESTAMP=`date "+%Y%m%d.%H%M%S"` PACKAGE_VERSION=`git rev-parse --short HEAD` -APPLICATION_CUSTOMER_ENTITY=${APPLICATION_CUSTOMER_ENTITY:-"Chatopera CC Cloud"} - -$baseDir/package.sh +APPLICATION_CUSTOMER_ENTITY=${APPLICATION_CUSTOMER_ENTITY:-"OpenSource Community"} if [ ! $? -eq 0 ]; then exit 1