forked from e-gov/RIHA-Browser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
47 lines (42 loc) · 1.02 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
image: riha-test-env
variables:
DEPLOYMENT_DIR: "/opt/riha/$CI_PROJECT_NAME"
ARTIFACT_NAME: "$CI_PROJECT_NAME.jar"
stages:
- test
- build
- deploy
test:
stage: test
before_script:
- node -v
- npm -v
script:
- ./test.sh
tags:
- riha
build:
stage: build
script:
- ./build.sh
artifacts:
paths:
- backend/target/*.jar
tags:
- riha
deploy_development:
stage: deploy
script:
- echo "$SSH_PRIVATE_KEY" > id_rsa
- chmod 700 id_rsa
- mkdir $HOME/.ssh
- echo "$SSH_HOST_KEY" > $HOME/.ssh/known_hosts
- scp -i id_rsa backend/target/*.jar deployer@$SSH_HOST:$DEPLOYMENT_DIR/$ARTIFACT_NAME
- ssh -i id_rsa deployer@$SSH_HOST "/bin/chmod ug+x $DEPLOYMENT_DIR/$ARTIFACT_NAME"
- ssh -i id_rsa deployer@$SSH_HOST "/sbin/service $CI_PROJECT_NAME restart"
environment:
name: development
url: http://$SSH_HOST:$PORT/
when: manual
tags:
- riha