-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
36 lines (33 loc) · 1.29 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
# This file is a template, and might need editing before it works on your project.
# Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/node/tags/
# deploy_development:
# type: deploy
# environment:
# name: development
# url: api.quickplay.app
# script:
# - ssh $SERVER_USER@$SERVER_HOST "cd /data1/opt/emtiv-backend && sudo git pull origin development-mobile-api && sudo pm2 reload all && exit"
# only:
# - development-mobile-api
stages:
- deploy
deploy:
stage: deploy
environment:
name: development
url: api.quickplay.app
before_script:
- apt-get update -qq
- apt-get install -qq git
- 'which ssh-agent || ( apt-get install -qq openssh-client )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
# - echo "IdentityFile ~/.ssh/id_rsa" >> /etc/ssh/ssh_config
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
script:
- ssh -tt $SERVER_USER@$SERVER_HOST "cd /opt/emtiv-backend && sudo git pull http://$GIT_USER:$GIT_PASSWORD@103.253.113.215:8091/emtiv/backend/emtiv-backend.git development && sudo npm install && sudo pm2 reload emtiv-backend && exit"
only:
- development