Skip to content

Commit

Permalink
#830 dockerize set filters
Browse files Browse the repository at this point in the history
  • Loading branch information
hailiang-wang committed Jun 15, 2023
1 parent 306e06e commit e54c425
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
26 changes: 12 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -18,27 +18,25 @@ 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
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
2 changes: 2 additions & 0 deletions contact-center/admin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e54c425

Please sign in to comment.