This repository has been archived by the owner on Feb 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.yml
135 lines (126 loc) · 3.84 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
version: 2
jobs:
build_and_push: &build_and_push
docker:
- image: docker:git
steps:
- checkout
- setup_remote_docker
- run:
name: Build image
command: |
apk update
apk add gettext # for envsubst command
envsubst < "./${IMAGE_TYPE}/Dockerfile" | \
docker build -t "${IMAGE_TYPE}" -f - "${IMAGE_TYPE}"
- run:
name: Push images
command: |
only_on_branch=master
if [ "${CIRCLE_BRANCH}" == "${only_on_branch}" ]; then
if [ ! -z "${DOCKER_USER}" ] && [ ! -z "${DOCKER_PASS}" ]; then
echo "${DOCKER_PASS}" | docker login -u "${DOCKER_USER}" --password-stdin
for tag in ${TAGS}; do
IMAGE_TAG=${CIRCLE_PROJECT_USERNAME}/${IMAGE_NAME}:${tag}
echo "Tagging image ${IMAGE_TAG}"
docker tag "${IMAGE_TYPE}" "${IMAGE_TAG}"
docker push "${IMAGE_TAG}"
done
else
echo "Not pushing: no DOCKER_USER and DOCKER_PASS variables."
fi
else
echo "Not pushing: branch '${CIRCLE_BRANCH}' is not '${only_on_branch}'."
fi
python-3.6-alpine:
<<: *build_and_push
environment:
- IMAGE_TYPE=python
- IMAGE_NAME=python
- TAGS=3.6-alpine
- PYTHON_VERSION=3.6
- REQUIREMENTS=base
python-3.7-alpine:
<<: *build_and_push
environment:
- IMAGE_TYPE=python
- IMAGE_NAME=python
- TAGS=3.7-alpine alpine latest
- PYTHON_VERSION=3.7
- REQUIREMENTS=base
django-2.0-python-3.6-alpine:
<<: *build_and_push
environment:
- IMAGE_TYPE=python
- IMAGE_NAME=django
- TAGS=2.0-py3.6 2.0-py3.6-alpine
- PYTHON_VERSION=3.6
- REQUIREMENTS=django-2.0
django-2.0-python-3.7-alpine:
<<: *build_and_push
environment:
- IMAGE_TYPE=python
- IMAGE_NAME=django
- TAGS=2.0 2.0-py3.7 2.0-py3.7-alpine 2.0-alpine
- PYTHON_VERSION=3.7
- REQUIREMENTS=django-2.0
django-2.1-python-3.6-alpine:
<<: *build_and_push
environment:
- IMAGE_TYPE=python
- IMAGE_NAME=django
- TAGS=2.1-py3.6 2.1-py3.6-alpine py3.6 py3.6-alpine
- PYTHON_VERSION=3.6
- REQUIREMENTS=django-2.1
django-2.1-python-3.7-alpine:
<<: *build_and_push
environment:
- IMAGE_TYPE=python
- IMAGE_NAME=django
- TAGS=2.1 2.1-py3.7 2.1-py3.7-alpine py3.7 py3.7-alpine 2.1-alpine alpine latest
- PYTHON_VERSION=3.7
- REQUIREMENTS=django-2.1
ansible-2.6:
<<: *build_and_push
environment:
- IMAGE_TYPE=ansible-playbook
- IMAGE_NAME=ansible-playbook
- TAGS=2.6
- ANSIBLE_VERSION=2.6.0
ansible-2.7:
<<: *build_and_push
environment:
- IMAGE_TYPE=ansible-playbook
- IMAGE_NAME=ansible-playbook
- TAGS=2.7
- ANSIBLE_VERSION=2.7.0
ucam-webauth-proxy:
<<: *build_and_push
environment:
- IMAGE_TYPE=ucam-webauth-proxy
- IMAGE_NAME=ucam-webauth-proxy
- TAGS=0.9 0.9.1 0.9-ucamwebauth-2.0.5 0.9-ucamwebauth-latest 0.9.1-ucamwebauth-2.0.5 0.9.1-ucamwebauth-latest ucamwebauth-2.0.5 ucamwebauth-latest latest
workflows:
version: 2
# A workflow which happens on each commit
build_and_push: &build_and_push_workflow
jobs:
- python-3.6-alpine
- django-2.0-python-3.6-alpine
- django-2.1-python-3.6-alpine
- python-3.7-alpine
- django-2.0-python-3.7-alpine
- django-2.1-python-3.7-alpine
- ansible-2.6
- ansible-2.7
- ucam-webauth-proxy
# # The build_and_push flow but run nightly
# nightly:
# <<: *build_and_push_workflow
# triggers:
# - schedule:
# cron: "13 3 * * *"
# filters:
# branches:
# only:
# - master