-
torgiren authored
The image chage resued old dev-stage image, so it's needed to tag every image with different tag Signed-off-by:
Marcin Fabrykowski <git@fabrykowski.pl>
Unverifiedb08dbb52
This GitLab CI configuration is valid.
Learn more
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
80
81
82
83
stages:
- prepare
- build_app
- tests
- build
- push
- deploy
.registry:
before_script:
- echo -n $CI_REGISTRY_PASSWORD | podman login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
buildapp:
stage: build_app
image: quay.io/podman/stable
extends: .registry
script:
- podman pull ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}-dev || true
- >
podman build
--pull
-f Dockerfile-dev
--cache-from ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}-dev
--tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}-dev
.
- podman push ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}-dev
tests:
stage: tests
image: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}-dev
script:
- cd /app
- npm run test:ci
- cp -r /app/test_out $CI_PROJECT_DIR
artifacts:
reports:
cobertura: test_out/cobertura-coverage.xml
junit: test_out/junit.xml
build:
stage: build
image: quay.io/podman/stable
extends: .registry
script:
- podman pull $CI_REGISTRY_IMAGE:latest || true
- >
podman build
--pull
--build-arg APPVER=${CI_COMMIT_SHORT_SHA}-dev
--build-arg APPIMAGE=${CI_REGISTRY_IMAGE}
--cache-from $CI_REGISTRY_IMAGE:latest
--tag $CI_REGISTRY_IMAGE:dev
.
- podman push $CI_REGISTRY_IMAGE:dev
push latest:
variables:
GIT_STRATEGY: none
image: quay.io/podman/stable
stage: push
extends: .registry
only:
- master
script:
- podman pull $CI_REGISTRY_IMAGE:dev
- podman tag $CI_REGISTRY_IMAGE:dev $CI_REGISTRY_IMAGE:latest
- podman push $CI_REGISTRY_IMAGE:latest
push tag:
variables:
GIT_STRATEGY: none
image: quay.io/podman/stable
stage: push
extends: .registry
only:
- tags
script:
- podman pull $CI_REGISTRY_IMAGE:dev
- podman tag $CI_REGISTRY_IMAGE:dev $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
- podman push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME