forked from Trendyol/kafka-retry-job
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
49 lines (43 loc) · 1.07 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
variables:
VERSION: "1.12.5"
DOCKER_IMAGE_VERSION: $GITLAB_REGISTRY_HOST/$CI_PROJECT_PATH:$VERSION
DOCKER_IMAGE_LATEST: $GITLAB_REGISTRY_HOST/$CI_PROJECT_PATH
stages:
- Test
- Version Check
- Release
.dind:
services:
- docker:19.03.5-dind
variables:
DOCKER_HOST: "tcp://localhost:2375"
DOCKER_TLS_CERTDIR: ""
DOCKER_DRIVER: overlay2
Test:
stage: Test
image: mcr.microsoft.com/dotnet/sdk:5.0
extends: .dind
script:
- dotnet test -c Release
allow_failure: false
Version Check:
stage: Version Check
only:
- master
script:
- apt-get update && apt-get install -y curl jq
- bash version_check.sh
allow_failure: true
Release:
stage: Release
image: docker:19.03.5
extends: .dind
when: manual
only:
- master
script:
- docker login -u $GITLAB_REGISTRY_USER -p $GITLAB_REGISTRY_PASS $GITLAB_REGISTRY_HOST
- docker build -t $DOCKER_IMAGE_VERSION -t $DOCKER_IMAGE_LATEST .
- docker push $DOCKER_IMAGE_VERSION
- docker push $DOCKER_IMAGE_LATEST
- docker rmi $DOCKER_IMAGE_VERSION $DOCKER_IMAGE_LATEST