before_script: - bash .gitlab-ci.sh stages: - testing - staging variables: MYSQL_DATABASE: default MYSQL_USER: default MYSQL_PASSWORD: secret MYSQL_ROOT_PASSWORD: root unitTesting: stage: testing image: php:7.2.6 services: - mysql:5.7 script: - vendor/bin/phpunit --coverage-text --colors=never staging: stage: staging before_script: - mkdir -p ~/.ssh - echo -e "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - '[[ ! -e /.dockerenv ]] && exit 0' script: - ssh izyim@40.76.84.105 "git pull origin master && sudo docker-compose -f docker-prod.yml up -d" environment: name: staging when: manual