-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
59 lines (53 loc) · 1.63 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
48
49
50
51
52
53
54
55
56
57
58
59
image: maven:latest
variables:
MAVEN_CLI_OPTS: "-DskipTests"
cache:
paths:
- .m2/repository/
- target/
stages:
- build
- config
- deploy
build:
stage: build
script:
- mvn $MAVEN_CLI_OPTS package -e -P prod
- mkdir -p deployment/ait/sw/fair-wizard
- cp target/fair-wizard-*.jar deployment/ait/sw/fair-wizard/fair-wizard.jar
artifacts:
paths:
- deployment/ait/sw/fair-wizard/fair-wizard.jar
copy-config:
image: maven:3.6-jdk-11
stage: config
script:
- git clone https://$FW_INTERNAL_USER:[email protected]/biosamples/fair-wizard-internal.git
- cp -r fair-wizard-internal/www/* deployment/
- ls deployment/
artifacts:
paths:
- deployment
only:
- master
- dev
deploy:
image: ubuntu
stage: deploy
script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client git -y )'
- eval $(ssh-agent -s)
- echo "$BSD_PROD_SSH_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan wp-p2m-27.ebi.ac.uk >> ~/.ssh/known_hosts
- ssh-keyscan wp-p1m-27.ebi.ac.uk >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- scp -r -v -o StrictHostKeyChecking=no deployment/* [email protected]:~/
- ssh -v -o StrictHostKeyChecking=no [email protected] "~/ait/tools/monit-5.32.0/bin/monit restart fair-wizard"
- scp -r -v -o StrictHostKeyChecking=no deployment/* [email protected]:~/
- ssh -v -o StrictHostKeyChecking=no [email protected] "~/ait/tools/monit-5.32.0/bin/monit restart fair-wizard"
when: manual
only:
- master
- dev