-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
37 lines (36 loc) · 1.34 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
# Cache downloaded dependencies and plugins between builds.
# Not strictly necessary, but speeds up the builds.
cache:
key: "$CI_JOB_NAME"
paths:
# Must be within the repository under test hence we can't use the
# default ~/.m2
- .m2/repository
variables:
# Use the cached directory above.
MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository"
deploy:
image: maven:3.6.1-jdk-11 # docker image with Maven
before_script:
# The runners on the forge need a proxy to access the web. mvn
# ignores the $http_proxy & friends variable => write a
# configuration file that does this for us.
- . setup-mvn-proxy.sh
- 'which ssh-agent || ( apt-get install -qq openssh-client )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY"
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
# Useful only for debugging
#- cat ~/.m2/settings.xml
script:
- cd users/
- mvn clean package
- 'scp target/usersspringboot-0.0.1-SNAPSHOT.jar [email protected]:'
- cd ../
- 'scp -r app/client/public/dist/ [email protected]:'
- 'scp -r app/server/ [email protected]:'
- ssh [email protected] "screen -dm bash startSpring.sh && screen -dm bash startNode.sh"
only:
- master