Created
August 14, 2019 05:46
-
-
Save anuraagdjain/56dd08eecb56ab170308d0270d2f3400 to your computer and use it in GitHub Desktop.
Multi-Environment Gitlab
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
image: ubuntu:latest | |
variables: | |
WORK_DIR: ${CI_PROJECT_NAME} | |
BRANCH: ${CI_COMMIT_REF_NAME} | |
stages: | |
- staging | |
- production | |
staging: | |
stage: staging | |
environment: | |
name: 'staging' | |
script: | |
- echo "$STAGING_ENV" > .env.staging.tmp | |
- # decode and rename the file to .env.staging | |
- # deploy to server | |
- # restart server | |
only: | |
- staging | |
production: | |
stage: production | |
environment: | |
name: 'production' | |
script: | |
- echo "$PROD_ENV" > .env.production.tmp | |
- # decode and rename the file to .env.production | |
- # deploy to server | |
- # restart server | |
only: | |
- production |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment