.gitlab-ci.yml 522 Bytes
Newer Older
siick's avatar
test CI  
siick committed
1 2
before_script:
  # Setup SSH deploy keys
siick's avatar
test CI  
siick committed
3
  - 'which ssh-agent || ( apk update && apk add openssh-client git -y )'
siick's avatar
test CI  
siick committed
4 5 6 7 8
  - eval $(ssh-agent -s)
  - echo "$PKEY" | tr -d '\r' | ssh-add -
  - mkdir -p ~/.ssh
  - chmod 700 ~/.ssh
  - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
siick's avatar
siick committed
9 10 11 12 13 14 15

deploy_staging:
  type: deploy
  environment:
    name: production
    url: $URL
  script:
siick's avatar
test CI  
siick committed
16
    - ssh $USER@$URL -p $PORT "cd /var/www/html/services && git pull origin master && exit"
siick's avatar
siick committed
17
  only:
siick's avatar
test CI  
siick committed
18
    - master