Working on Proof of Concept (POC) with a very basic/simple pipeline flow: feature → dev → qa → uat → production.
Merging a feature branch into dev runs as detached (which, if I understand correctly, isn’t ideal) and (I think) because it is detached, the pipeline can’t read the env vars (to access AWS).
But, when I merge dev branch into qa, the MR and pipeline run successfully and not detached
- What am I doing wrong / how do I merge a feature branch into dev (and start the pipeline correctly).
Details - gitlab-ci.yml
The feature branch doesn’t have a stage or job in the pipeline. Once it is ready, I want to merge the feature into dev, which should then kick off the pipeline.
The below script works (does not run detached) if I merge from dev into qa:
stages: - dev - qa dev-jobs: stage: dev rules: - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "dev" || $CI_COMMIT_BRANCH == "dev"' - if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS' when: never before_script: - # omitted for clarity script: - serverless deploy --stage dev --verbose environment: name: dev/$CI_COMMIT_REF_NAME qa-job: stage: qa rules: - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "qa"' - if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS' when: never # do not run a commit push if there is an open merge request - if: "$CI_COMMIT_BRANCH == 'qa'" before_script: - # script things that work on push to dev script: - serverless deploy --stage qa --verbose environment: name: qa/$CI_COMMIT_REF_NAME
What troubleshooting steps have you already taken?
I protected the feature branch - it wasn’t initially nor do I think it should be?
Pipelines for MR
AWS ENV Vars Not Accessed but is 2 years old and not similar in execution.
I’ve looked for merging feature branches into dev/main but haven’t found anything that seems similar.