-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
.gitlab-ci.yml
43 lines (38 loc) · 1019 Bytes
/
.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
variables:
DOCKER_DRIVER: overlay2
MAVEN_OPTS: -Dmaven.repo.local=/cache/maven/repository
stages:
- build
- deploy
build:
stage: build
image: openjdk:8-jdk-slim
script: "./mvnw -B package"
tags:
- docker
artifacts:
paths:
- target/*.war
deploy-nimrod:
stage: deploy
image: alpine:3.7
before_script:
- "apk update"
- "apk add openssh rsync zip"
- "eval $(ssh-agent -s)"
- "echo \"$SSH_PRIVATE_KEY\" | ssh-add - > /dev/null"
- "mkdir -p ~/.ssh"
- "[[ -f /.dockerenv ]] && echo \"$SSH_SERVER_HOSTKEYS\" > ~/.ssh/known_hosts"
script:
- "mkdir -p target/unzipped"
- "unzip -o target/*.war -d target/unzipped"
- "sed -i \"s/password: postgres/password: $DB_PASSWORD/g\" target/unzipped/WEB-INF/classes/application.yml"
- "cd target/unzipped"
- "zip -r ../npm-stat.war ./"
- "rsync --chmod 644 ../npm-stat.war [email protected]:/var/lib/tomcat10/webapps/npm-stat.war"
only:
- master
tags:
- docker
dependencies:
- build