-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
50 lines (46 loc) · 1.48 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
image: maven:latest
stages:
- compile
- test
- deploy
maven_compile:
stage: compile
tags:
- maven
script:
- mvn compile
maven test:
stage: test
tags:
- maven
script:
- mvn test
maven_deploy:
stage: deploy
tags:
- maven
- artifactory
before_script:
#SSH agent
- 'which ssh-agent || ( apk update && apk add openssh)'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
#GPG (gnupg)
- 'which gpg-agent || ( apk update && apk add gnupg)'
- gpg -v --batch --import <(echo "$GPG_PRIVATE_KEY")
# Install JFrog CLI / configure artifactory
- curl -fL https://getcli.jfrog.io | sh
- ./jfrog rt config --url=$ARTIFACTORY_URL --user=$ARTIFACTORY_USER --password=$ARTIFACTORY_PASS
- ./jfrog rt c show
- export M2_HOME=/usr/share/maven
- sed -i 's,SNAPSHOT_REPO_KEY,'"$SNAPSHOT_REPO_KEY"',g' configuration.yml
- sed -i 's,RELEASE_REPO_KEY,'"$RELEASE_REPO_KEY"',g' configuration.yml
- sed -i 's,ARTIFACTORY_JCENTER_REPO_KEY,'"$ARTIFACTORY_JCENTER_REPO_KEY"',g' configuration.yml
script:
- ./jfrog rt mvn "clean verify gpg:sign install -DadditionalJOption=-Xdoclint:none" configuration.yml --build-name=solvers_gitlabci_build --build-number=$CI_JOB_ID
- ./jfrog rt bce solvers_gitlabci_build $CI_JOB_ID
- ./jfrog rt bp solvers_gitlabci_build $CI_JOB_ID
only:
- master