-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
63 lines (56 loc) · 2.18 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
default:
image: maven:3-openjdk-11
stages:
- prepare
- test
- publish
variables:
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true -Dmaven.repo.local=.m2/repository"
# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
cache:
key:
files:
- pom.xml
prefix: "$CI_JOB_NAME"
paths:
- ./driver/.m2/repository
prepare:
stage: prepare
image: gitlab.desy.de:5555/dcache/self-signed-certs:latest
variables:
GITHUB_WORKSPACE: certs
script:
- mkdir ${GITHUB_WORKSPACE}
- /entrypoint.sh hostcert.pem hostkey.pem ca-chain.pem
artifacts:
paths:
- ${GITHUB_WORKSPACE}
test:
stage: test
script:
- pwd
- mkdir -p /etc/grid-security/
- mv certs/hostcert.pem /etc/grid-security/.
- mv certs/hostkey.pem /etc/grid-security/.
- echo $CI_RUNNER_SHORT_TOKEN
- echo "Now building with maven"
- cd driver
- mvn ${MAVEN_CLI_OPTS} clean package
- echo "Now packing python-scripts and conf-file"
- cd ..
- mkdir packer/target
- tar -c -f packer/target/packer-${CI_COMMIT_TAG}.tar.gz packer/src/*.py packer/conf/container.conf
artifacts:
paths:
- driver/target/*.tar.gz
- packer/target/packer*.tar.gz
publish:
stage: publish
rules:
- if: $CI_COMMIT_TAG
script:
- echo "Publishing packages for version ${CI_COMMIT_TAG}"
- export MAJOR_RELEASE_VERSION=`echo ${CI_COMMIT_TAG#"Sapphire-"} | cut -d . -f 1-2`
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file packer/target/*.tar.gz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/packer/${MAJOR_RELEASE_VERSION}/sapphire-packer-${CI_COMMIT_TAG}.tar.gz"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file driver/target/*.tar.gz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/driver/${MAJOR_RELEASE_VERSION}/sapphire-driver-${CI_COMMIT_TAG}.tar.gz"'