2021-02-06 10:09:18 +00:00
|
|
|
version: 2
|
|
|
|
jobs:
|
2021-07-08 13:37:00 +00:00
|
|
|
build_latest:
|
2021-02-06 10:09:18 +00:00
|
|
|
docker:
|
2021-08-23 02:04:08 +00:00
|
|
|
- image: circleci/golang:1.17
|
2021-02-06 10:09:18 +00:00
|
|
|
working_directory: ~/twhelpdcbot
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- setup_remote_docker
|
|
|
|
# start proprietary DB using private Docker image
|
|
|
|
# with credentials stored in the UI
|
|
|
|
- run: |
|
|
|
|
docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
|
|
|
|
# build the application image
|
2021-02-06 10:10:11 +00:00
|
|
|
- run: docker build -t $DOCKER_LOGIN/twhelp-dcbot:latest .
|
2021-02-06 10:09:18 +00:00
|
|
|
# deploy the image
|
2021-02-06 10:10:11 +00:00
|
|
|
- run: docker push $DOCKER_LOGIN/twhelp-dcbot:latest
|
2021-07-08 13:37:00 +00:00
|
|
|
build_version:
|
|
|
|
docker:
|
2021-08-23 02:04:08 +00:00
|
|
|
- image: circleci/golang:1.17
|
2021-07-08 13:37:00 +00:00
|
|
|
working_directory: ~/twhelpdcbot
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- setup_remote_docker
|
|
|
|
# start proprietary DB using private Docker image
|
|
|
|
# with credentials stored in the UI
|
|
|
|
- run: |
|
|
|
|
docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
|
|
|
|
# build the application image
|
|
|
|
- run: docker build -t $DOCKER_LOGIN/twhelp-dcbot:$(echo $CIRCLE_TAG | sed -r 's/^.{1}//') .
|
|
|
|
# deploy the image
|
|
|
|
- run: docker push $DOCKER_LOGIN/twhelp-dcbot:$(echo $CIRCLE_TAG | sed -r 's/^.{1}//')
|
2021-02-06 10:09:18 +00:00
|
|
|
workflows:
|
|
|
|
version: 2
|
2021-07-08 13:37:00 +00:00
|
|
|
deploy_latest:
|
2021-02-06 10:09:18 +00:00
|
|
|
jobs:
|
2021-07-08 13:37:00 +00:00
|
|
|
- build_latest:
|
2021-02-06 10:09:18 +00:00
|
|
|
context: TWHelp
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
2021-07-08 13:37:00 +00:00
|
|
|
deploy_version:
|
|
|
|
jobs:
|
|
|
|
- build_version:
|
|
|
|
context: TWHelp
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /^v.*/
|
|
|
|
branches:
|
|
|
|
ignore: /.*/
|