-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path.gitlab-ci.yml
40 lines (37 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
image: node:9.11-stretch
stages:
# - test
- build
# - deploy
#run tests for every commit
#test:
# stage: test
# script: "mvn test --batch-mode"
#run the build with artifacts only for commits to develop and master after tests were run
build:
stage: build
only:
- master
script:
- npm install
- npm run build
artifacts:
when: on_success
paths:
- _dist/
#deploy:
# stage: deploy
# only:
# - master
# dependencies:
# - build
# script:
# - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
# - 'which rsync || ( apt-get update -y && apt-get install rsync -y )'
# - eval $(ssh-agent -s)
# - ssh-add <(echo "$SSH_PRIVATE_KEY")
# - '[[ -f /.dockerenv ]] && mkdir -p ~/.ssh && echo "$KNOWN_HOST" > ~/.ssh/known_hosts'
# - ssh [email protected] 'echo 'execute some remote cmds' && pwd && ls -lhaA'
# deploy files either with scp or rsync
# - scp -rpv ./* [email protected]:/var/lib/tomcat8/webapps/viz/
# - rsync -rvlp --exclude '.git' ./* [email protected]:/var/lib/tomcat8/webapps/viz/