-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.gitlab-ci.yml_
38 lines (36 loc) · 971 Bytes
/
.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
stages:
- build
build-web-app:
stage: build
image: docker:24.0.7
services:
- docker:24.0.7-dind
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE/web-app:$CI_COMMIT_SHORT_SHA
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- cd web-app
- docker build
--build-arg CI_COMMIT_SHA="$CI_COMMIT_SHA"
--file ./docker/Dockerfile
--tag $IMAGE_TAG .
- docker push $IMAGE_TAG
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
build-api:
stage: build
image: docker:24.0.7
services:
- docker:24.0.7-dind
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE/api:$CI_COMMIT_SHORT_SHA
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- cd api
- docker build
--build-arg CI_COMMIT_SHA="$CI_COMMIT_SHA"
--file ./Dockerfile
--tag $IMAGE_TAG .
- docker push $IMAGE_TAG
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH