forked from cloudonix/ARIty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
77 lines (68 loc) · 1.62 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
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
MAVEN_OPTS: "-Dmaven.repo.local=.m2"
MAVEN_IMG: maven:3-jdk-11
cache:
paths:
- .m2/
stages:
- setup
- test
- package
- s3
offline-deps:
stage: setup
image: $MAVEN_IMG
script:
- '[ "$(($RANDOM%10))" == 0 ] && mvn -B -U dependency:go-offline || mvn -B dependency:go-offline'
test:
stage: test
image: $MAVEN_IMG
script:
- mvn -B test || true
artifacts:
expire_in: 1 week
paths:
- target
deploy:maven:
stage: package
needs: [ package ]
image: $MAVEN_IMG
script:
- >
mvn -B -s gitlab-maven-settings.xml -DskipTests -Dmaven.gpg.skip=true
-DaltDeploymentRepository=gitlab-maven::default::${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/maven
deploy
# rules:
# - if: $CI_COMMIT_TAG
package:
stage: package
image: $MAVEN_IMG
script:
- mvn -B -DskipTests package
- mvn -B -DaltDeploymentRepository=repo::default::file:./target/staging deploy -DskipTests
- cp target/arity-*-fat.jar target/staging/io/cloudonix/arity/*/
artifacts:
expire_in: 1 week
paths:
- target
s3:
stage: s3
script:
- pip install awscli
- aws s3 sync --storage-class REDUCED_REDUNDANCY --acl public-read ./target/staging/ s3://cloudonix-dist/maven2/releases
image: python:3.6.6-stretch
only:
- master
s3-snapshots:
stage: s3
image:
name: mesosphere/aws-cli
entrypoint: [""]
script:
- aws s3 sync --storage-class REDUCED_REDUNDANCY --acl public-read ./target/staging/ s3://cloudonix-dist/maven2/snapshots
only:
- develop