I have 2 branches: stage and master - and each of them has its own .gitlab-ci.yml with different scripts. How is it possible to exclude these files from merge-request, so that they remain unique for each of the branches?
i tried with gitattributes and merge strategy - but this method only works locally. Then I decided to create one common gitlab-ci.yml for all branches, but in this case it is necessary to set the conditions for the execution of different jobs for different branches. I tried in the following way:
runTests_job:
stage: runTests
tags:
- ps
rules:
- if: $CI_COMMIT_BRANCH == "stage"
script:
- chcp 65001
- Invoke-Sqlcmd -ConnectionString $CONNSTR -Query "EXEC dbo.test"
but the job was still running in the master branch. Also tried:
runTests_job:
stage: runTests
tags:
- ps
only:
refs:
- stage
script:
- chcp 65001
- Invoke-Sqlcmd -ConnectionString $CONNSTR -Query "EXEC dbo.test"
but it didn't work. Maybe I made a mistake in the syntax somewhere?