-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
42 lines (36 loc) · 1.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
image: maven:3-jdk-8
stages:
- build
- deploy
variables:
MAVEN_OPTS: "-Dmaven.repo.local=.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"
cache:
paths:
- .m2/repository
key: "$CI_BUILD_REPO"
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo "$SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts'
build_p2:
stage: build
only:
- master
script:
- 'mvn $MAVEN_CLI_OPTS package'
artifacts:
paths:
- com.felixmorgner.clycer.updatesite/target/site
deploy_p2:
stage: deploy
only:
- master
script:
- 'scp -r com.felixmorgner.clycer.updatesite/target/site [email protected]:/var/www/felixmorgner/clycer/update/${CI_JOB_ID}'
- 'ssh [email protected] "cd /var/www/felixmorgner/clycer/update && ./compile"'
artifacts:
paths:
- com.felixmorgner.clycer.updatesite/target/site