forked from Fraunhofer-AISEC/trusted-connector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
41 lines (38 loc) · 1.47 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
# make sure to use a Debian-based image, because otherwise you will run into issue with protoc because of missing glibc on alpine
image: node:stretch
stages:
- build
- push
build:
stage: build
variables:
GRADLE_USER_HOME: "/cache/.gradle"
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
before_script:
# caching for gradle
- mkdir -p /cache/.gradle
# caching for mvn (used for karaf-assembly)
- mkdir -p /root/.m2
- echo $M2_SETTINGS > ~/.m2/settings.xml
- mkdir -p /cache/.m2
# install deps
- apt update && apt install -y --no-install-recommends openjdk-8-jdk-headless
script:
# yarnBuild is part of build, however this could speed up the process a little bit by prioritizing the long-running yarnBuild
# TODO: setting dockerTag does not work
- ./gradlew --parallel -DdockerTag=${CI_COMMIT_SHA:0:8} clean yarnBuild build dockerize
artifacts:
when: always
paths:
- "*/build/reports"
# tag develop builds as latest and push them to the internal registry
push:
stage: push
image: docker
script:
- docker tag fraunhoferaisec/iot-connector-core-platform:null registry.netsec.aisec.fraunhofer.de/ids/core-platform:${CI_COMMIT_SHA:0:8}
- docker tag fraunhoferaisec/iot-connector-core-platform:null registry.netsec.aisec.fraunhofer.de/ids/core-platform:latest
- docker push registry.netsec.aisec.fraunhofer.de/ids/core-platform:${CI_COMMIT_SHA:0:8}
- docker push registry.netsec.aisec.fraunhofer.de/ids/core-platform:latest
only:
- develop