This repository has been archived by the owner on Sep 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 66
/
.gitlab-ci.yml
59 lines (54 loc) · 2.03 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: node:14.5.0-alpine
stages:
- test
- deploy
lint_test:
stage: test
only:
- development
- staging
- master
- merge_requests
script:
- apk add g++ make python
- yarn
- $(pwd)/node_modules/.bin/eslint $(pwd)
cache:
paths:
- node_modules/
dev_deploy:
stage: deploy
only:
- development
script:
- apk add openssh-client
- eval $(ssh-agent -s)
- echo "${DEV_SSH_KEY}" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
- ssh -o "StrictHostKeyChecking=no" ${DEV_SSH_USER}@${DEV_SSH_SERVER} "mkdir -p /tmp/juno/website"
- scp -o "StrictHostKeyChecking=no" $(pwd)/scripts/dev_deploy.sh ${DEV_SSH_USER}@${DEV_SSH_SERVER}:/tmp/juno/website/dev_deploy.sh
- ssh -o "StrictHostKeyChecking=no" ${DEV_SSH_USER}@${DEV_SSH_SERVER} "bash /tmp/juno/website/dev_deploy.sh"
staging_deploy:
stage: deploy
only:
- staging
script:
- apk add openssh-client
- eval $(ssh-agent -s)
- echo "${STAGING_SSH_KEY}" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
- ssh -o "StrictHostKeyChecking=no" ${STAGING_SSH_USER}@${STAGING_SSH_SERVER} "mkdir -p /tmp/juno/website"
- scp -o "StrictHostKeyChecking=no" $(pwd)/scripts/staging_deploy.sh ${STAGING_SSH_USER}@${STAGING_SSH_SERVER}:/tmp/juno/website/staging_deploy.sh
- ssh -o "StrictHostKeyChecking=no" ${STAGING_SSH_USER}@${STAGING_SSH_SERVER} "bash /tmp/juno/website/staging_deploy.sh"
prod_deploy:
stage: deploy
only:
- master
script:
- apk add openssh-client
- eval $(ssh-agent -s)
- echo "${PROD_SSH_KEY}" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
- ssh -o "StrictHostKeyChecking=no" ${PROD_SSH_USER}@${PROD_SSH_SERVER} "mkdir -p /tmp/juno/website"
- scp -o "StrictHostKeyChecking=no" $(pwd)/scripts/prod_deploy.sh ${PROD_SSH_USER}@${PROD_SSH_SERVER}:/tmp/juno/website/prod_deploy.sh
- ssh -o "StrictHostKeyChecking=no" ${PROD_SSH_USER}@${PROD_SSH_SERVER} "bash /tmp/juno/website/prod_deploy.sh"