-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
77 lines (70 loc) · 1.97 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
stages:
- test
- publish
- static scans
- publish pages
variables:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: libats_slick
MYSQL_PASSWORD: libats_slick
MYSQL_DATABASE: libats_slick
DB_URL: jdbc:mariadb://mariadb:3306/libats_slick
KAFKA_HOST: kafka:9092
KAFKA_ZOOKEEPER_CONNECT: kafka:2181
VAULT_ADDR: "http://vault.sit-ota.aws.in.here.com"
# The same image have to be used by test and code coverage jobs:
TEST_IMAGE: advancedtelematic/gitlab-jobs:0.2.5
services:
- name: mariadb:10.2
command: ["mysqld", "--character-set-server=utf8", "--collation-server=utf8_unicode_ci", "--max_connections=1000"]
- name: spotify/kafka
alias: kafka
test:
image: $TEST_IMAGE
# Keep image in sync with code coverage job below
stage: test
before_script:
- mysql --protocol=TCP --host=mariadb --user=root --port 3306 -proot -e \ GRANT\ ALL\ PRIVILEGES\ ON\ \`libats_slick%\`.\*\ TO\ \'libats_slick\'@\'%\'\;
script:
- sbt -sbt-dir ./.sbt -ivy ./.ivy2 clean coverage test
artifacts:
paths:
- "libats*/target/scala-*/scoverage-data"
- "libats*/target/scala-*/src_managed"
cache:
paths:
- .ivy2/
- .sbt/
code coverage:
extends: .report_scala_coverage
needs: ["test"]
image: $TEST_IMAGE
allow_failure: true
before_script:
- sbt -sbt-dir ./.sbt -ivy ./.ivy2 coverageAggregate
publish:
stage: publish
tags:
- docker-sock
image: advancedtelematic/gitlab-jobs:0.2.5
only:
- master
except:
- schedules
script:
- git fetch origin
- git describe
- export VAULT_TOKEN=$(cat /opt/vault/token)
- gitlab-docker-login $VAULT_ADDR
- eval $(set-vault-env -v $VAULT_ADDR --secret gitlab/ats-aws-key --secret gitlab/maven-publish)
- sbt -sbt-dir ./.sbt -ivy ./.ivy2 +publish
cache:
paths:
- .ivy2/
- .sbt/
include:
- template: Secret-Detection.gitlab-ci.yml
- template: License-Scanning.gitlab-ci.yml
- project: olp/edge/ota/infra/security
ref: v0.0.9
file: /shared.yaml