Files
IIMTT/.gitlab-ci.yml
2021-03-19 21:42:47 +00:00

30 lines
915 B
YAML

image: php:7.2
stages:
- deploy
before_script:
- "which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )"
- "which rsync || ( apt-get update -y && apt-get install rsync -y )"
#- "which yarn || ( apt-get update -y && apt-get install yarn -y )"
- eval $(ssh-agent -s)
- echo "$v8_pk" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan -p 24 $v8_ip >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
#- mkdir CONFIG
#- echo $config > $CI_PROJECT_DIR/CONFIG/config.php
#- yarn
deploy:
stage: deploy
script:
- rsync -Ppr -e "ssh -p 24" --progress --exclude=".git" $CI_PROJECT_DIR/ $v8_user@$v8_ip:$v8_pwd
# Non interactive ssh gracefully reloads server
#- ssh $hawk_bs_user@$hawk_bs_ip '. /etc/profile; pm2 reload all'
only:
# Trigger deployments only from production branch
#- production
- master