44# Check https://circleci.com/docs/2.0/language-python/ for more details
55#
66---
7- version : 2.1
8- executors :
9- # here we can define an executor that will be shared across different jobs
10- docker-executor :
11- docker :
12- - image : docker:stable-dind
13- # environment:
14- # ENV_VAR: ENV_VALUE
15- working_directory : /root/docker
16- resource_class : small
17- jobs :
18- build-docker-generic :
19- executor : docker-executor
20- parameters :
21- python_version :
22- type : string
23- default : " 3.7"
24- docker_type :
25- type : string
26- default : " cpu"
27- steps :
28- - checkout
29- - setup_remote_docker
30- - run :
31- name : Build and push image
32- command : |
33- docker login -u "$DOCKERHUB_LOGIN" -p "$DOCKERHUB_TOKEN"
34- docker build ./dockerfiles/<< parameters.python_version >>/<< parameters.docker_type >>/ -t bazire/python:<< parameters.python_version >>-<< parameters.docker_type >>
35- docker push bazire/python:<< parameters.python_version >>-<< parameters.docker_type >>
36- workflows :
37- version : 2
38- docker-python-build-all :
39- jobs :
40- - build-docker-generic :
41- context : dockerhub
42- python_version : " 3.7"
43- docker_type : " cpu"
44- filters :
45- branches :
46- only :
47- - master
48- - build-docker-generic :
49- context : dockerhub
50- python_version : " 3.7"
51- docker_type : " gpu"
52- filters :
53- branches :
54- only :
55- - master
56- - build-docker-generic :
57- context : dockerhub
58- python_version : " 3.8"
59- docker_type : " cpu"
60- filters :
61- branches :
62- only :
63- - master
64- - build-docker-generic :
65- context : dockerhub
66- python_version : " 3.8"
67- docker_type : " gpu"
68- filters :
69- branches :
70- only :
71- - master
72- - build-docker-generic :
73- context : dockerhub
74- python_version : " 3.9-rc"
75- docker_type : " cpu"
76- filters :
77- branches :
78- only :
79- - master
80- - build-docker-generic :
81- context : dockerhub
82- python_version : " 3.9-rc"
83- docker_type : " gpu"
84- filters :
85- branches :
86- only :
87- - master
7+ version : 2.1
8+ executors :
9+ # here we can define an executor that will be shared across different jobs
10+ docker-executor :
11+ docker :
12+ - image : docker:stable-dind
13+ # environment:
14+ # ENV_VAR: ENV_VALUE
15+ working_directory : /root/docker
16+ resource_class : small
17+ jobs :
18+ build-docker-generic :
19+ executor : docker-executor
20+ parameters :
21+ python_version :
22+ type : string
23+ default : " 3.7"
24+ docker_type :
25+ type : string
26+ default : " cpu"
27+ steps :
28+ - checkout
29+ - setup_remote_docker
30+ - run :
31+ name : Build and push image
32+ command : |
33+ docker login -u "$DOCKERHUB_LOGIN" -p "$DOCKERHUB_TOKEN"
34+ docker build ./dockerfiles/<< parameters.python_version >>/<< parameters.docker_type >>/ -t bazire/python:<< parameters.python_version >>-<< parameters.docker_type >>
35+ docker push bazire/python:<< parameters.python_version >>-<< parameters.docker_type >>
36+ workflows :
37+ version : 2
38+ docker-python-build-all :
39+ jobs :
40+ - build-docker-generic :
41+ context : dockerhub
42+ python_version : " 3.7"
43+ docker_type : " cpu"
44+ filters :
45+ branches :
46+ only :
47+ - master
48+ - build-docker-generic :
49+ context : dockerhub
50+ python_version : " 3.7"
51+ docker_type : " gpu"
52+ filters :
53+ branches :
54+ only :
55+ - master
56+ - build-docker-generic :
57+ context : dockerhub
58+ python_version : " 3.8"
59+ docker_type : " cpu"
60+ filters :
61+ branches :
62+ only :
63+ - master
64+ - build-docker-generic :
65+ context : dockerhub
66+ python_version : " 3.8"
67+ docker_type : " gpu"
68+ filters :
69+ branches :
70+ only :
71+ - master
72+ - build-docker-generic :
73+ context : dockerhub
74+ python_version : " 3.9-rc"
75+ docker_type : " cpu"
76+ filters :
77+ branches :
78+ only :
79+ - master
80+ - build-docker-generic :
81+ context : dockerhub
82+ python_version : " 3.9-rc"
83+ docker_type : " gpu"
84+ filters :
85+ branches :
86+ only :
87+ - master
0 commit comments