This repository has been archived by the owner on Dec 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.gitlab-ci.yml
77 lines (69 loc) · 2.13 KB
/
.gitlab-ci.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
image: docker:latest
services:
- docker:dind
stages:
- build
- notifications
variables:
REGISTRY: "docker.io"
REGISTRY_USER: "robpco"
RELEASE_IMAGE: "nginx-uwsgi-flask-mssql"
REGISTRY_IMAGE: "${REGISTRY}/${REGISTRY_USER}/${RELEASE_IMAGE}"
build27:
stage: build
script:
- docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASSWORD"
- docker build --pull --tag "${REGISTRY_IMAGE}:2.7" --tag "${REGISTRY_IMAGE}:py2.7" --tag "${REGISTRY_IMAGE}:python2.7" ./python2.7/
- docker push "${REGISTRY_IMAGE}:2.7"
- docker push "${REGISTRY_IMAGE}:py2.7"
- docker push "${REGISTRY_IMAGE}:python2.7"
only:
variables:
- $CI_COMMIT_TAG =~ /^deploy+/
retry: 2
build36:
stage: build
script:
- docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASSWORD"
- docker build --pull --tag "${REGISTRY_IMAGE}:3.6" --tag "${REGISTRY_IMAGE}:py3.6" --tag "${REGISTRY_IMAGE}:python3.6" ./python3.6/
- docker push "${REGISTRY_IMAGE}:3.6"
- docker push "${REGISTRY_IMAGE}:py3.6"
- docker push "${REGISTRY_IMAGE}:python3.6"
only:
variables:
- $CI_COMMIT_TAG =~ /^deploy+/
retry: 2
build37:
stage: build
script:
- docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASSWORD"
- docker build --pull --tag "${REGISTRY_IMAGE}:3.7" --tag "${REGISTRY_IMAGE}:py3.7" --tag "${REGISTRY_IMAGE}:python3.7" ./python3.7/
- docker push "${REGISTRY_IMAGE}:3.7"
- docker push "${REGISTRY_IMAGE}:py3.7"
- docker push "${REGISTRY_IMAGE}:python3.7"
only:
variables:
- $CI_COMMIT_TAG =~ /^deploy+/
retry: 2
notify_succcess_slack:
stage: notifications
allow_failure: true
script:
- apk --update add curl
- date=$(date +%Y%m%d-%H%M)
- './.cicd/notify_slack.sh "#builds" "$RELEASE_IMAGE - build success at $date"'
when: on_success
only:
variables:
- $CI_COMMIT_TAG =~ /^deploy+/
notify_fail_slack:
stage: notifications
allow_failure: true
script:
- apk --update add curl
- date=$(date +%Y%m%d-%H%M)
- './.cicd/notify_slack.sh "#builds" "$RELEASE_IMAGE - build failure at $date"'
when: on_failure
only:
variables:
- $CI_COMMIT_TAG =~ /^deploy+/