-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path.gitlab-ci.yml
79 lines (72 loc) · 1.75 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
stages:
# - test
- build
# - deploy
# .has_changes_rule:
# rules:
# - if: $CI_COMMIT_BRANCH
# changes:
# - src/**/*.js
# - src/**/*.jsx
# - src/**/*.json
# - ./*.js
# - ./*.json
# .no_changes_rule:
# rules:
# - if: $CI_COMMIT_BRANCH
# changes:
# - src/**/*.js
# - src/**/*.jsx
# - src/**/*.json
# - ./*.js
# - ./*.json
# when: never
# - if: $CI_COMMIT_BRANCH
# when: always
# lint:
# stage: test
# image: registry.gitlab.com/yesolutions/docker-pre-commit
# extends: .has_changes_rule
# script:
# - pre-commit run --all-files
# noop_fallback:
# stage: test
# extends: .no_changes_rule
# script:
# - echo "No change detected! this pipeline will always run, very quickly."
build:
stage: build
image: docker:20.10.14-git
needs: []
services:
- docker:20.10.14-dind
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
DOCKER_BUILDKIT: '1'
DOCKER_TLS_CERTDIR: ''
IMAGE_TAG: ${CI_REGISTRY_IMAGE}:$CI_COMMIT_REF_SLUG
FE_TAG: ${CI_REGISTRY_IMAGE}:$CI_COMMIT_REF_SLUG-fe
before_script:
- git checkout-index --all --prefix umask-fix-checkout/
- cd umask-fix-checkout
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- |
docker build \
--target frontend \
--cache-from $FE_TAG \
--tag $FE_TAG \
--build-arg BUILDKIT_INLINE_CACHE=1 \
-f Dockerfile-basic \
"."
- docker push $FE_TAG
- |
docker build \
--target backend \
--cache-from $IMAGE_TAG \
--tag $IMAGE_TAG \
--build-arg BUILDKIT_INLINE_CACHE=1 \
-f Dockerfile-basic \
"."
- docker push $IMAGE_TAG