Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
September 15, 2021 05:07 pm GMT

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:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To