For a project me & my team are working on we need to implement the following with Gitlab CI:
After a MR has been merged on a release branch a pipeline should trigger a build job and automatically start deploy job that deploys to our dev environment. A manual action is available for deploying to staging.
For production this would be the same case as with the release but then for master.
Currently I have not found a way to start certain jobs or a pipeline directly after a MR has been merged.
The most simplest way is to use the only keyword and specify the branches as per your requirement
Sample: If you would like to run specific job only on the MR’s then you can specify only: merge_requests
Once the MR is merged - eventually the master or the branch where the merge occurred will be updated - as a result the pipeline will be triggered, you can specify the custom jobs to run post merge using the only: master
I’ve a db migrations repo in the branch DEV-23-Q4(Branch for Dev Database Changes). I want to run a flyway job as soon as some scripts are MERGED into the branch. flyway parameters are :
host: dev-host
dbname: - has to get from the changes that are merged into the branch’s repo. If changes are pushed for multiple databases, multiple jobs has to trigger one after the other.
schemaname: same as db name
username : same as db name
password: should be encoded
extra params : -outOfOrder=true,
action= repair, info, migrate
anyone who has done this , can you please guide me