-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
61 lines (50 loc) · 1.85 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
variables:
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
image: maven:3.3.9-jdk-8
cache:
paths:
- .m2/repository
build test:
stage: build
variables:
CI_COMMIT_TAG: test
script:
- mkdir -p $CI_PROJECT_DIR/.m2/repository
- cp lib/ccjava-api.jar $CI_PROJECT_DIR/.m2/repository/
- mvn package
artifacts:
paths: ['target/jsonata-${CI_COMMIT_TAG}.jar']
expire_in: 1 hour
when: manual
build:
stage: build
script:
- mkdir -p $CI_PROJECT_DIR/.m2/repository
- cp lib/ccjava-api.jar $CI_PROJECT_DIR/.m2/repository/
- mvn package
artifacts:
paths: ['target/jsonata-${CI_COMMIT_TAG}.jar']
expire_in: 1 hour
only:
- tags
upload:
dependencies:
- build
image: curlimages/curl:latest
stage: deploy
script:
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file "target/jsonata-${CI_COMMIT_TAG}.jar" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/jsonata/${CI_COMMIT_TAG}/jsonata-${CI_COMMIT_TAG}.jar"'
only:
- tags
release_job:
stage: deploy
dependencies:
- build
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
script:
- env
- echo 'running release_job'
- 'release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG --description "$CI_COMMIT_TAG: $CI_COMMIT_TITLE $CI_COMMIT_DESCRIPTION" --assets-link "{\"name\":\"jsonata ${CI_COMMIT_TAG}\",\"url\":\"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/jsonata/${CI_COMMIT_TAG}/jsonata-${CI_COMMIT_TAG}.jar\"}"'