Created
April 26, 2017 12:24
-
-
Save lsmith77/dd7846690f10b1905c0090d7e878c6c6 to your computer and use it in GitHub Desktop.
This file contains 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
# /dev/ci/setup_ssh.sh | |
#!/usr/bin/env bash | |
which ssh-agent || (apt-get update -y && apt-get install openssh-client -y) | |
eval $(ssh-agent -s) | |
ssh-add <(echo "$PLATFORMSH_DEPLOY_KEY") | |
mkdir -p ~/.ssh | |
[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config | |
# .gitlab-ci.yml | |
# deploy to platform.sh staging - develop environment | |
deploy_staging_develop: | |
stage: deploy | |
only: [ develop ] | |
environment: | |
name: Staging - develop | |
url: https://develop-XXX.eu.platform.sh/ | |
dependencies: [ test_app ] | |
script: | |
- source dev/ci/setup_ssh.sh | |
- git remote -v | grep platform || git remote add platform XXX@git.eu.platform.sh:XXX.git | |
- git checkout develop | |
- git pull --rebase | |
- git push platform develop | |
# deploy to platform.sh staging - master environment | |
deploy_staging_master: | |
stage: deploy | |
only: [ master ] | |
environment: | |
name: Staging - master | |
url: https://master-XXX.eu.platform.sh/ | |
dependencies: [ test_app ] | |
script: | |
- source dev/ci/setup_ssh.sh | |
- git remote -v | grep platform || git remote add platform XXX@git.eu.platform.sh:XXX.git | |
- git checkout master | |
- git pull --rebase | |
- git push platform master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment