Skip to content

Commit 28ace32

Browse files
authored
Merge pull request #68 from OperationCode/pybot_dockerhub
Migrate to using DOCKERHUB instead of ECR.
2 parents c3fa031 + 50d6db2 commit 28ace32

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

.circleci/config.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ workflows:
1010
jobs:
1111
- build_test
1212

13+
# push new Docker image to Docker Hub
14+
- dockerhub_build_and_push:
15+
requires:
16+
- build_test
17+
filters:
18+
branches:
19+
only:
20+
- master
21+
22+
1323
# push new Docker image to ECS
1424
- aws-ecr/build_and_push_image:
1525
repo: pybot
@@ -78,3 +88,25 @@ jobs:
7888
7989
- store_test_results:
8090
path: test-results
91+
92+
dockerhub_build_and_push:
93+
docker:
94+
- image: circleci/python:3.7.1
95+
96+
steps:
97+
- checkout
98+
99+
- setup_remote_docker:
100+
docker_layer_caching: true
101+
102+
- run:
103+
name: Build and push to DockerHub
104+
command: |
105+
echo ${DOCKER_HUB_PASSWORD} | docker login -u ${DOCKER_HUB_USERNAME} --password-stdin
106+
107+
docker build -f docker/Dockerfile \
108+
-t operationcode/pybot:${CIRCLE_BUILD_NUM} \
109+
-t operationcode/pybot:latest .
110+
111+
docker push operationcode/pybot:latest
112+
docker push operationcode/pybot:${CIRCLE_BUILD_NUM}

0 commit comments

Comments
 (0)