-
Notifications
You must be signed in to change notification settings - Fork 45
/
.gitlab-ci.yml
62 lines (48 loc) · 1.61 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
variables:
# Debug and tracing.
#CI_DEBUG_TRACE: "true"
#GIT_CURL_VERBOSE: "1"
#GIT_DEBUG_LOOKUP: "1"
#GIT_TRACE: "1"
#GIT_TRACE_PACKET: "1"
#GIT_TRANSLOOP_DEBUG: "1"
#GIT_TRANSPORT_HELPER_DEBUG: "1"
stages:
- build
.build_push_template: &build_push_definition
stage: build
only:
- preprod
- master
script:
- docker build --pull -t "$NAMESPACE/php:${CI_JOB_NAME}" "${CI_JOB_NAME}/"
- docker push "$NAMESPACE/php:${CI_JOB_NAME}"
- |
if [[ "$CI_BUILD_REF_NAME" = "master" ]]; then
docker tag "$NAMESPACE/php:${CI_JOB_NAME}" "$CI_REGISTRY_IMAGE:${CI_JOB_NAME}"
docker push "$CI_REGISTRY_IMAGE:${CI_JOB_NAME}"
fi
before_script:
#- if [[ "$CI_BUILD_REF_NAME" != master ]]; then echo $AW_REGISTRY_PASSWORD | docker login -u "$AW_REGISTRY_USER" --password-stdin $AW_REGISTRY; AW_REGISTRY="$AW_REGISTRY/$CI_BUILD_REF_NAME"; fi
#- if [[ "$CI_BUILD_REF_NAME" = "master" ]]; then docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY; fi
- echo $AW_REGISTRY_PASSWORD | docker login -u "$AW_REGISTRY_USER" --password-stdin $AW_REGISTRY
- echo $CI_REGISTRY_PASSWORD | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
- export NAMESPACE=$AW_REGISTRY/library
8.1-fpm:
<<: *build_push_definition
8.1-apache:
<<: *build_push_definition
8.1-cli:
<<: *build_push_definition
8.0-fpm:
<<: *build_push_definition
8.0-apache:
<<: *build_push_definition
8.0-cli:
<<: *build_push_definition
7.4-fpm:
<<: *build_push_definition
7.4-apache:
<<: *build_push_definition
7.4-cli:
<<: *build_push_definition