-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
47 lines (38 loc) · 1.41 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
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/mysql:${CI_JOB_NAME}" "${CI_JOB_NAME}/"
- docker push "$NAMESPACE/mysql:${CI_JOB_NAME}"
- |
if [[ "$CI_BUILD_REF_NAME" = "master" ]]; then
docker tag "$NAMESPACE/mysql:${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.0':
<<: *build_push_definition
'5.7':
<<: *build_push_definition
'5.6':
<<: *build_push_definition
'5.5':
<<: *build_push_definition