Add sync_dev_branch job to GitLab CI for syncing production changes into dev
This commit is contained in:
@@ -4,6 +4,7 @@ stages:
|
|||||||
- prepare
|
- prepare
|
||||||
- test
|
- test
|
||||||
- build
|
- build
|
||||||
|
- sync
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
CI_REGISTRY_IMAGE: $CI_REGISTRY/$CI_PROJECT_PATH
|
CI_REGISTRY_IMAGE: $CI_REGISTRY/$CI_PROJECT_PATH
|
||||||
@@ -11,4 +12,19 @@ variables:
|
|||||||
|
|
||||||
include:
|
include:
|
||||||
- local: 'backend/.gitlab-ci.yml'
|
- local: 'backend/.gitlab-ci.yml'
|
||||||
- local: 'finlog_app/.gitlab-ci.yml'
|
- local: 'finlog_app/.gitlab-ci.yml'
|
||||||
|
|
||||||
|
sync_dev_branch:
|
||||||
|
stage: sync
|
||||||
|
image: node:22@sha256:f6b9c31ace05502dd98ef777aaa20464362435dcc5e312b0e213121dcf7d8b95
|
||||||
|
rules:
|
||||||
|
- if: '$CI_COMMIT_BRANCH == "production"'
|
||||||
|
before_script:
|
||||||
|
- git config --global user.email "gitlab-ci@rhein-software.dev"
|
||||||
|
- git config --global user.name "GitLab CI"
|
||||||
|
script:
|
||||||
|
- git remote set-url origin "https://oauth2:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git"
|
||||||
|
- git checkout dev
|
||||||
|
- git pull origin dev
|
||||||
|
- git merge --no-ff origin/production
|
||||||
|
- git push origin dev
|
||||||
|
|||||||
Reference in New Issue
Block a user