-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
70 lines (62 loc) · 1.79 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
stages:
- compile
- test
- check
- build
- package
.setup-mvn: &setup-mvn
- chmod a+x mvnw
variables:
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
cache:
paths:
- .m2/repository/
- "**/target/"
compile:
stage: compile
image: ${CI_REGISTRY}/bi-ido/bi-ido-registry/maven:3.8.6-openjdk-18
script:
- *setup-mvn
- ./mvnw clean compile
test:
stage: test
image: ${CI_REGISTRY}/bi-ido/bi-ido-registry/markhobson/maven-chrome:jdk-18 # this image as well uses maven 3.8.6
script:
- *setup-mvn
- ./mvnw test
artifacts:
name: "Surefire test reports from $CI_PROJECT_NAME on $CI_COMMIT_REF_SLUG"
expire_in: 1 day
reports:
junit:
- "**/target/surefire-reports/TEST-*.xml"
check:
stage: build
image: ${CI_REGISTRY}/bi-ido/bi-ido-registry/maven:3.8.6-openjdk-18
script:
- chmod a+x mvnw
- ./mvnw clean compile dependency-check:aggregate
- ./mvnw sonar:sonar -Dsonar.projectKey=flight-log-tiulinaz -Dsonar.projectName=flight-log-tiulinaz -Dsonar.host.url=$SONAR_URL -Dsonar.token=$SONAR_TOKEN
build:
stage: build
image: ${CI_REGISTRY}/bi-ido/bi-ido-registry/maven:3.8.6-openjdk-18
script:
- *setup-mvn
- ./mvnw package -DskipTests
artifacts:
name: "Maven artifacts from $CI_PROJECT_NAME on $CI_COMMIT_REF_SLUG"
paths:
- "**/target/*.jar"
container:
stage: package
image: $CI_REGISTRY/ict/images/alpine/ci:latest
variables:
BUILDAH_ISOLATION: chroot
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
before_script:
- apk add --no-cache ca-certificates curl buildah fuse-overlayfs netavark
- buildah login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- buildah info
script:
- buildah build --tag $IMAGE_TAG -f Dockerfile
- buildah push --retry 3 $IMAGE_TAG