Last active
August 20, 2021 14:08
-
-
Save dungdm93/65c4802c9c9897c582f510aa419db650 to your computer and use it in GitHub Desktop.
GitLab-CI: Deploy Scripts
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:paas-gae: | |
stage: deploy | |
image: google/cloud-sdk | |
before_script: | |
- echo "${GCLOUD_SERVICE_KEY}" > /tmp/.gsa.key | |
- gcloud auth activate-service-account --key-file /tmp/.gsa.key | |
- gcloud config set project "${PROJECT_NAME}" # TODO: change this | |
script: | |
- gcloud app deploy | |
environment: | |
name: production | |
url: https://awesome.site | |
# allow_failure: false | |
# when: manual | |
# only: | |
# - master |
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:vm-ansible: | |
stage: deploy | |
image: dungdm93/ansible:ubuntu16.04 | |
before_script: | |
- eval "$(ssh-agent -s)" | |
- ssh-add <(echo "$SSH_PRIVATE_KEY") | |
# or | |
# - ssh-add <(cat "$SSH_PRIVATE_KEY_FILE") | |
script: | |
- ansible-playbook -i ansible/inventory ansible/playbook.yml -l ${CI_ENVIRONMENT_NAME} | |
environment: | |
name: production | |
url: https://awesome.site | |
# allow_failure: false | |
# when: manual | |
# only: | |
# - master |
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:vm-ssh: | |
stage: deploy | |
image: dungdm93/openssh:alpine3.6 | |
before_script: | |
- eval "$(ssh-agent -s)" | |
- ssh-add <(echo "$SSH_PRIVATE_KEY") | |
script: | |
- ssh user@server < scripts.sh | |
# --or-- | |
# ssh user@server < scripts.sh "bash -s -- arg01 arg02" | |
environment: | |
name: production | |
url: https://awesome.site | |
# allow_failure: false | |
# when: manual | |
# only: | |
# - master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment