Created
August 7, 2018 10:29
-
-
Save itsgoingd/3bbea629f2000d26aca7f4b5096adf67 to your computer and use it in GitHub Desktop.
GitLab CD example for a Laravel app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deploy to staging: | |
image: bobey/docker-gitlab-ci-runner-php7 | |
environment: | |
name: staging | |
url: https://test.example.com | |
only: | |
- master | |
script: | |
- wget -q https://getcomposer.org/composer.phar | |
- mkdir -p ~/.ssh | |
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config | |
- eval $(ssh-agent -s) | |
- ssh-add <(echo "$SSH_KEY") | |
- php composer.phar install --prefer-dist --quiet | |
- ./vendor/bin/dep deploy staging | |
deploy to production: | |
image: bobey/docker-gitlab-ci-runner-php7 | |
environment: | |
name: production | |
url: https://example.com | |
only: | |
- /^release-.*$/ | |
script: | |
- wget -q https://getcomposer.org/composer.phar | |
- mkdir -p ~/.ssh | |
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config | |
- eval $(ssh-agent -s) | |
- ssh-add <(echo "$SSH_KEY") | |
- php composer.phar install --prefer-dist --quiet | |
- ./vendor/bin/dep deploy production |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment