-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
79 lines (72 loc) · 1.95 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
before_script:
- apt-get update -qq
- apt-get install -qq git
# Setup SSH deploy keys
- 'which ssh-agent || ( apt-get install -qq openssh-client )'
- eval $(ssh-agent -s)
# - ssh-add <(echo "$SSH_PRIVATE_KEY" | base64 --decode)
# - Odroid part
# - private key must be b64 encoded https://www.base64encode.org/ and include "---begin rsa"... and "--- end rsa..."
# - new way of doing such a thing : https://docs.gitlab.com/ee/ci/ssh_keys/ --> copy/paste full id_rsa private key (with "begin" and "end" characters, and not b64 encode it
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
stages:
- pull
- test
- deploy
- analysis
pull_changes:
stage: pull
environment:
name: production
url: lazyker.ghyslain.xyz
script:
- ssh ghyslain@ghyslain.xyz "cd lazyker && git reset --hard && git clean -f && git pull"
only:
- nuc
test_backend:
stage: test
environment:
name: production
url: lazyker.ghyslain.xyz
script:
- ssh ghyslain@ghyslain.xyz "cd lazyker && ./deploy.sh test_backend"
only:
- nuc
deploy_nuc:
stage: deploy
environment:
name: production
url: lazyker.ghyslain.xyz
script:
- ssh ghyslain@ghyslain.xyz "cd lazyker && ./deploy.sh docker"
only:
- nuc
backend_analysis:
stage: analysis
environment:
name: production
url: lazyker.ghyslain.xyz
script:
- ssh ghyslain@ghyslain.xyz "cd lazyker && ./deploy.sh backend_analysis"
only:
- nuc
frontend_analysis:
stage: analysis
environment:
name: production
url: lazyker.ghyslain.xyz
script:
- ssh ghyslain@ghyslain.xyz "cd lazyker && ./deploy.sh frontend_analysis"
only:
- nuc
lighthouse_analysis:
stage: analysis
environment:
name: production
url: lazyker.ghyslain.xyz
script:
- ssh ghyslain@ghyslain.xyz "cd lazyker && ./deploy.sh lighthouse_analysis"
only:
- nuc