Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ workflows:
jobs:
- build_test

# push new Docker image to Docker Hub
- dockerhub_build_and_push:
requires:
- build_test
filters:
branches:
only:
- master


# push new Docker image to ECS
- aws-ecr/build_and_push_image:
repo: pybot
Expand Down Expand Up @@ -78,3 +88,25 @@ jobs:

- store_test_results:
path: test-results

dockerhub_build_and_push:
docker:
- image: circleci/python:3.7.1

steps:
- checkout

- setup_remote_docker:
docker_layer_caching: true

- run:
name: Build and push to DockerHub
command: |
echo ${DOCKER_HUB_PASSWORD} | docker login -u ${DOCKER_HUB_USERNAME} --password-stdin

docker build -f docker/Dockerfile \
-t operationcode/pybot:${CIRCLE_BUILD_NUM} \
-t operationcode/pybot:latest .

docker push operationcode/pybot:latest
docker push operationcode/pybot:${CIRCLE_BUILD_NUM}