-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
73 lines (66 loc) · 2.14 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
stages:
- build
- test
- containerize
- release
variables:
GRADLE_USER_HOME: "$CI_PROJECT_DIR/.cache/.gradle"
cache:
paths:
- .cache/.gradle
prepareEnv4test:
stage: build
image: registry.gitlab.com/coverified/infrastructure/scala-base:latest
script: ./gradlew prepareEnvironment -PnoOfConcurrentWorker=1 -PbatchSize=1 -PgraphQLApi="https://www.coverified.info" -PauthSecret=thisIsSecret -PkiApi="https://www.coverified.info" -PinternalSchedulerInterval=-1
artifacts:
reports:
dotenv: build.env
expire_in: 12 hours
build4dockerImage:
stage: build
image: registry.gitlab.com/coverified/infrastructure/scala-base:latest
script:
- ./gradlew shadowJar
- ./gradlew buildDotEnv
artifacts:
reports:
dotenv: dockerBuild.env
paths:
- build/libs/
expire_in: 12 hours
#test:
# stage: test
# image: registry.gitlab.com/coverified/infrastructure/scala-base:latest
# script: ./gradlew checkScoverage
# artifacts:
# reports:
# junit: build/test-results/test/**/TEST-*.xml
# cobertura: build/reports/scoverage/cobertura.xml
# needs:
# - prepareEnv4test
buildDockerImage:
stage: containerize
image: docker:20
services:
- docker:20-dind
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build --pull -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA --build-arg PROJECT_NAME --build-arg PROJECT_VERSION --build-arg MAIN_CLASS --build-arg SENTRY_RELEASE=$CI_COMMIT_SHA .
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
- docker push --all-tags $CI_REGISTRY_IMAGE
needs:
- build4dockerImage
cache: {}
release-image:
stage: release
image: docker:20
services:
- docker:20-dind
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:latest
- docker push --all-tags $CI_REGISTRY_IMAGE
only:
- main
cache: {}