add Gitlab CI/CD
This commit is contained in:
parent
4fd74a694c
commit
769c3e525f
17
.gitlab-ci.yml
Normal file
17
.gitlab-ci.yml
Normal file
@ -0,0 +1,17 @@
|
||||
stages:
|
||||
- deploy
|
||||
|
||||
deploy:
|
||||
stage: deploy
|
||||
image: node:latest
|
||||
before_script:
|
||||
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client git -y )'
|
||||
- eval $(ssh-agent -s)
|
||||
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
|
||||
- mkdir -p ~/.ssh
|
||||
- chmod 700 ~/.ssh
|
||||
- ssh-keyscan repo.kinesis.games >> ~/.ssh/known_hosts
|
||||
- chmod 644 ~/.ssh/known_hosts
|
||||
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
|
||||
script:
|
||||
- ssh ubuntu@kinesis.games "cd /var/www/proximity-demo/ && sudo bash buildScript.sh"
|
7
buildScript.sh
Executable file
7
buildScript.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
git pull origin master
|
||||
npm i
|
||||
npm run-script build
|
||||
chown -R root:www-data .
|
||||
systemctl reload apache2
|
Loading…
x
Reference in New Issue
Block a user