-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
82 lines (74 loc) · 2.59 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
80
81
82
stages:
- build
- test
- containerize
- release
- trigger
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 -PuserAgent="userAgent" -PbrowseTimeout=90 -PtargetDateTimePattern="yyyy" -PtargetTimeZone="Europe/Berlin" -PapiUrl="https://www.coverified.info" -PauthSecret="authSecret" -PpageProfileDirectoryPath="in/some/directory" -PreAnalysisInterval=36 -PworkerPoolSize=200 -PrepeatDelay=20 -PmaxRetries=42
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 PAGE_PROFILE_SOURCE_DIRECTORY --build-arg PAGE_PROFILE_PATH --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: {}
trigger-build-with-config:
stage: trigger
trigger: coverified/infrastructure
variables:
IMAGE_TO_BUILD: content_extractor
IMAGE_HASH: $CI_COMMIT_SHA
IMAGE_BRANCH: $CI_COMMIT_REF_SLUG