Skip to content

Commit f986df9

Browse files
author
Roger Lam
authored
fix(docker): push to latest on tagging a new version (#350)
1 parent f4e24ef commit f986df9

File tree

2 files changed

+18
-28
lines changed

2 files changed

+18
-28
lines changed

.circleci/config.yml

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2.1
22

33
orbs:
44
release-tools: paperspace/[email protected]
5-
docker-tools: paperspace/[email protected].4
5+
docker-tools: paperspace/[email protected].6
66

77
_docker_image: &docker_image paperspace/gradient-sdk
88
_workspace_root: &workspace_root .
@@ -25,39 +25,13 @@ workflows:
2525
filters:
2626
branches:
2727
only: master
28-
- docker-tools/build_and_push:
29-
name: build_and_push_master
30-
context: docker-deploy
31-
docker_username: ${DOCKER_USERNAME}
32-
docker_password: ${DOCKER_PASSWORD}
33-
workspace_root: *workspace_root
34-
docker_image: *docker_image
35-
docker_tag: 0.0.0-latest
36-
requires:
37-
- test
38-
filters:
39-
branches:
40-
only: master
4128

4229
pr:
4330
jobs:
4431
- test:
4532
filters:
4633
branches:
4734
ignore: master
48-
- docker-tools/build_and_push:
49-
name: build_and_push
50-
context: docker-deploy
51-
docker_username: ${DOCKER_USERNAME}
52-
docker_password: ${DOCKER_PASSWORD}
53-
workspace_root: *workspace_root
54-
docker_image: *docker_image
55-
requires:
56-
- test
57-
filters:
58-
branches:
59-
ignore: master
60-
6135

6236
release:
6337
jobs:
@@ -78,6 +52,20 @@ workflows:
7852
only: /.*/
7953
branches:
8054
ignore: /.*/
55+
- docker-tools/build_and_push:
56+
name: build_and_push_latest
57+
context: docker-deploy
58+
docker_username: ${DOCKER_USERNAME}
59+
docker_password: ${DOCKER_PASSWORD}
60+
workspace_root: *workspace_root
61+
docker_image: *docker_image
62+
docker_tag: latest
63+
filters:
64+
tags:
65+
only: /.*/
66+
branches:
67+
ignore: /.*/
68+
docker_build_args: --build-arg VERSION=${CIRCLE_TAG}
8169

8270
executors:
8371
python-tox:

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
FROM python:3.8
22

3+
ARG VERSION
4+
35
RUN pip install --no-cache-dir --upgrade pip && \
4-
pip install --no-cache-dir gradient==1.5.0
6+
pip install --no-cache-dir gradient==$VERSION
57

68
ENV PAPERSPACE_API_KEY your_api_key_value
79
ENV PAPERSPACE_WEB_URL https://console.paperspace.com

0 commit comments

Comments
 (0)