An Interest In:
Web News this Week
- March 21, 2024
- March 20, 2024
- March 19, 2024
- March 18, 2024
- March 17, 2024
- March 16, 2024
- March 15, 2024
September 15, 2021 05:07 pm GMT
Original Link: https://dev.to/sats268842/gitlab-ci-cd-for-multiple-environment-54dj
Gitlab CI/CD for multiple environment
Have you tried implementing variables for various environments and using different jobs for various environments? I've come up with a solution for you.
image: node:latestvariables: GIT_DEPTH: '0' stages: - build - deployworkflow: rules: - if: $CI_COMMIT_REF_NAME == "develop" variables: DEVELOP: "true" ENVIRONMENT_NAME: Develop WEBSITE_URL: DEVELOP_WEBSITE_URL S3_BUCKET: (develop-s3-bucket-name) AWS_REGION: ************** develop AWS_ACCOUNT: ********develop - if: $CI_COMMIT_REF_NAME == "main" variables: PRODUCTION: "true" ENVIRONMENT_NAME: PRODUCTION WEBSITE_URL: $PROD_WEBSITE_URL S3_BUCKET: $PROD-S3-BUCKET-NAME AWS_REGION: ************** (prod-region) AWS_ACCOUNT: ***********(prod-acct) - when: always build-app: stage: build script: #build-script environment: name: $ENVIRONMENT_NAMEdeploy-app: stage: deploy script: #deploy-script environment: name: $ENVIRONMENT_NAME
NB: Please let me know if this procedure is correct. (Experts)
Original Link: https://dev.to/sats268842/gitlab-ci-cd-for-multiple-environment-54dj
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To