forked from smmccabe/docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
40 lines (33 loc) · 1.05 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
image: docker:git
stages:
- build
.docker:
image: docker:git
services:
- docker:dind
variables:
DOCKER_TLS_CERTDIR: ""
build_only:
extends: .docker
stage: build
except:
- master
script:
- docker build -t $CI_REGISTRY/$CI_PROJECT_PATH:php7.4 php7.4
- docker build -t $CI_REGISTRY/$CI_PROJECT_PATH:php7.3 php7.3
- docker build -t $CI_REGISTRY/$CI_PROJECT_PATH:php7.2 php7.2
build_deploy:
extends: .docker
stage: build
only:
- master
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
- docker build --no-cache -t $CI_REGISTRY/$CI_PROJECT_PATH:latest php7.4
- docker push $CI_REGISTRY/$CI_PROJECT_PATH:latest
- docker build -t $CI_REGISTRY/$CI_PROJECT_PATH:php7.4 php7.4
- docker push $CI_REGISTRY/$CI_PROJECT_PATH:php7.4
- docker build -t $CI_REGISTRY/$CI_PROJECT_PATH:php7.3 php7.3
- docker push $CI_REGISTRY/$CI_PROJECT_PATH:php7.3
- docker build -t $CI_REGISTRY/$CI_PROJECT_PATH:php7.2 php7.2
- docker push $CI_REGISTRY/$CI_PROJECT_PATH:php7.2