-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
40 lines (37 loc) · 1.11 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
variables:
REPO_NAME: gitlab.com/mironet/exim-relay-docker
stages:
- build
- release
# Build app.
build-app:
stage: build
image: docker:19
before_script:
- apk add --no-cache git
- git --version
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- export GIT_TAG=$(git describe --always)
- export DOCKER_BUILDKIT=1
script:
- echo $GIT_TAG
- docker build --pull -t "$CI_REGISTRY_IMAGE" -f docker/Dockerfile .
- docker push "$CI_REGISTRY_IMAGE"
# Build app.
build-tagged-app:
stage: build
image: docker:19
before_script:
- apk add --no-cache git
- git --version
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- export GIT_TAG=$(git describe --always)
- export DOCKER_BUILDKIT=1
script:
- echo $GIT_TAG
- docker build --pull -t "$CI_REGISTRY_IMAGE:$GIT_TAG" -f docker/Dockerfile .
- docker push "$CI_REGISTRY_IMAGE:$GIT_TAG"
- docker tag "$CI_REGISTRY_IMAGE:$GIT_TAG" "$CI_REGISTRY_IMAGE:latest"
- docker push "$CI_REGISTRY_IMAGE:latest"
only:
- /v[0-9|\.]+-?[0-9A-Za-z-]*/