-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
57 lines (44 loc) · 1.34 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
---
image: docker:latest
stages:
- build
- release
# login to private gitlab registry
before_script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
# ==========================
# Job templates
# ==========================
# special gitlab yaml feature, see: https://docs.gitlab.com/ce/ci/yaml/README.html#anchors
.build_php_template: &build_php_definition
stage: build
script:
- docker build -t $CONTAINER_IMAGE_NAME .
- docker push $CONTAINER_IMAGE_NAME
only:
- master
- feature/migrateToAlpineLinux
.release_docker_image_template: &release_docker_image_definition
stage: release
script:
- docker pull $CONTAINER_IMAGE_NAME
- docker tag $CONTAINER_IMAGE_NAME $CONTAINER_IMAGE_RELEASE_NAME
- docker push $CONTAINER_IMAGE_RELEASE_NAME
only:
- master
- feature/migrateToAlpineLinux
# ===================
# BUILD
# ===================
build_spryker_base_image:
<<: *build_php_definition
variables:
CONTAINER_IMAGE_NAME: $CI_REGISTRY/$CI_PROJECT_PATH:${CI_BUILD_REF}-alpine
# ===================
# RELEASE
# ===================
release_spryker_base_image:
<<: *release_docker_image_definition
variables:
CONTAINER_IMAGE_NAME: $CI_REGISTRY/$CI_PROJECT_PATH:${CI_BUILD_REF}-alpine
CONTAINER_IMAGE_RELEASE_NAME: $CI_REGISTRY/$CI_PROJECT_PATH:latest-alpine