Skip to content

Commit

Permalink
only allow docker builds for tagged commits on master
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Goodman committed Oct 22, 2019
1 parent 7576d7b commit 613713b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
14 changes: 11 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,14 @@ jobs:
PYTHON_TAG: python<< parameters.python-version >>
steps:
- checkout
- run:
name: Master branch check
command: |
apk add git
if [[ $(git branch --contains $CIRCLE_SHA1 --points-at master | wc -l) -ne 1 ]]; then
echo "commit $CIRCLE_SHA1 is not a member of the master branch"
exit 1
fi
- setup_remote_docker:
docker_layer_caching: true
- run:
Expand Down Expand Up @@ -350,21 +358,21 @@ workflows:
python-version: "3.5"
filters:
branches:
only: master
ignore: /.*/
tags:
only: /^[0-9]+\.[0-9]+\.[0-9]+$/
- build-docker-image:
python-version: "3.6"
filters:
branches:
only: master
ignore: /.*/
tags:
only: /^[0-9]+\.[0-9]+\.[0-9]+$/
- build-docker-image:
python-version: "3.7"
tag-latest: true
filters:
branches:
only: master
ignore: /.*/
tags:
only: /^[0-9]+\.[0-9]+\.[0-9]+$/
1 change: 0 additions & 1 deletion src/prefect/environments/storage/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ def __init__(
sys.version_info.major, sys.version_info.minor
)
if re.match("^[0-9]+\.[0-9]+\.[0-9]+$", self.prefect_version) != None:
# note: this does not necessarily mean that we have built/pushed all previous prefect versions to dockerhub
self.base_image = "prefecthq/prefect:{}-python{}".format(
self.prefect_version, python_version
)
Expand Down

0 comments on commit 613713b

Please sign in to comment.