forked from edbizarro/gitlab-ci-pipeline-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
156 lines (143 loc) · 6.89 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
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
stages:
- build
- build-chromium
- publish
- test
image: docker:latest
variables:
DOCKER_DRIVER: overlay2
NAMESPACE: creacoon/gitlab-ci-pipeline-php
DOCKER_HOST: tcp://registry.hub.docker.com:2375
services:
- docker:dind
before_script:
- echo "$DOCKER_REGISTRY_PASSWORD" | docker login --username $DOCKER_REGISTRY_USER --password-stdin $DOCKER_HOST
Debian 8.0:
stage: build
variables:
IMAGE_VERSION: "8.0"
script:
- docker pull php:$IMAGE_VERSION || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/$IMAGE_VERSION/Dockerfile .
- docker run -t --rm creacoon/gitlab-ci-pipeline-php:$IMAGE_VERSION -v
- docker run -t --rm creacoon/gitlab-ci-pipeline-php:$IMAGE_VERSION -m
- docker run -t --rm -v $(pwd):/var/www/html creacoon/gitlab-ci-pipeline-php:$IMAGE_VERSION goss -g tests/goss-$IMAGE_VERSION.yaml v
- docker tag $NAMESPACE:$IMAGE_VERSION $NAMESPACE:latest
- docker tag $NAMESPACE:$IMAGE_VERSION $NAMESPACE:8
- docker push $NAMESPACE:$IMAGE_VERSION
- docker push $NAMESPACE:8
- docker push $NAMESPACE:latest
when: always
Debian 7.4:
stage: build
variables:
IMAGE_VERSION: "7.4"
script:
- docker pull php:$IMAGE_VERSION || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/$IMAGE_VERSION/Dockerfile .
- docker run -t --rm creacoon/gitlab-ci-pipeline-php:$IMAGE_VERSION -m
- docker run -t --rm -v $(pwd):/var/www/html creacoon/gitlab-ci-pipeline-php:$IMAGE_VERSION goss -g tests/goss-$IMAGE_VERSION.yaml v
- docker tag $NAMESPACE:$IMAGE_VERSION $NAMESPACE:7
- docker push $NAMESPACE:$IMAGE_VERSION
- docker push $NAMESPACE:7
when: always
Alpine 8.0:
stage: build
variables:
IMAGE_VERSION: "8.0-alpine"
script:
- docker pull php:$IMAGE_VERSION || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/8.0/alpine/Dockerfile .
- docker run -t --rm -v $(pwd):/var/www/html $NAMESPACE:$IMAGE_VERSION goss -g tests/goss-8.0.yaml v
- docker tag $NAMESPACE:$IMAGE_VERSION $NAMESPACE:alpine
- docker push $NAMESPACE:$IMAGE_VERSION
- docker push $NAMESPACE:alpine
when: always
Alpine 8.0 LTS:
stage: build
variables:
IMAGE_VERSION: "8.0-alpine-lts"
script:
- docker pull php:8.0-alpine || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/8.0/alpine/Dockerfile-lts .
- docker run -t --rm -v $(pwd):/var/www/html $NAMESPACE:$IMAGE_VERSION goss -g tests/goss-lts.yaml v
- docker tag $NAMESPACE:$IMAGE_VERSION $NAMESPACE:alpine-lts
- docker push $NAMESPACE:$IMAGE_VERSION
- docker push $NAMESPACE:alpine-lts
when: always
Alpine 7.4:
stage: build
variables:
IMAGE_VERSION: "7.4-alpine"
script:
- docker pull php:$IMAGE_VERSION || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/7.4/alpine/Dockerfile .
- docker run -t --rm -v $(pwd):/var/www/html $NAMESPACE:$IMAGE_VERSION goss -g tests/goss-7.4.yaml v
- docker push $NAMESPACE:$IMAGE_VERSION
when: always
Alpine 7.4 LTS:
stage: build
variables:
IMAGE_VERSION: "7.4-alpine-lts"
script:
- docker pull php:7.4-alpine || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/7.4/alpine/Dockerfile-lts .
- docker run -t --rm -v $(pwd):/var/www/html $NAMESPACE:$IMAGE_VERSION goss -g tests/goss-lts.yaml v
- docker push $NAMESPACE:$IMAGE_VERSION
when: always
FPM 8.0:
stage: build
variables:
IMAGE_VERSION: "8.0-fpm"
script:
- docker pull php:$IMAGE_VERSION || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/8.0/fpm/Dockerfile .
- docker run -t --rm -v $(pwd):/var/www/html $NAMESPACE:$IMAGE_VERSION goss -g tests/goss-8.0.yaml v
- docker tag $NAMESPACE:$IMAGE_VERSION $NAMESPACE:fpm
- docker push $NAMESPACE:$IMAGE_VERSION
- docker push $NAMESPACE:fpm
when: always
FPM 7.4:
stage: build
variables:
IMAGE_VERSION: "7.4-fpm"
script:
- docker pull php:$IMAGE_VERSION || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/7.4/fpm/Dockerfile .
- docker run -t --rm -v $(pwd):/var/www/html $NAMESPACE:$IMAGE_VERSION goss -g tests/goss-7.4.yaml v
- docker push $NAMESPACE:$IMAGE_VERSION
when: always
Chromium 8.0:
stage: build-chromium
variables:
IMAGE_VERSION: "8.0-chromium"
script:
- docker pull php:$IMAGE_VERSION || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/8.0/chromium/Dockerfile .
- docker run -t --rm -v $(pwd):/var/www/html creacoon/gitlab-ci-pipeline-php:$IMAGE_VERSION goss -g tests/goss-8.0.yaml v
- docker push $NAMESPACE:$IMAGE_VERSION
when: always
dependencies:
- Debian 8.0
Chromium 7.4:
stage: build-chromium
variables:
IMAGE_VERSION: "7.4-chromium"
script:
- docker pull php:$IMAGE_VERSION || true
- docker pull $NAMESPACE:$IMAGE_VERSION || true
- docker build --compress --cache-from $NAMESPACE:$IMAGE_VERSION --build-arg VCS_REF=$CI_COMMIT_SHORT_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -t $NAMESPACE:$IMAGE_VERSION -f php/7.4/chromium/Dockerfile .
- docker run -t --rm -v $(pwd):/var/www/html creacoon/gitlab-ci-pipeline-php:$IMAGE_VERSION goss -g tests/goss-7.4.yaml v
- docker push $NAMESPACE:$IMAGE_VERSION
when: always
dependencies:
- Debian 7.4