Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2018-11-29 18:10:23 +0300
committerYorick Peterse <yorickpeterse@gmail.com>2018-12-04 16:40:04 +0300
commitee6fb2b1eec9645f82eaa0796ca283a4a146278a (patch)
treeb35b581837defdb84bd0d94af7f3f60c565c96a3 /.gitlab-ci.yml
parent8cd5004b350ef342f66956c11272dad1328f6526 (diff)
Automatically merge CE master into EE master
This sets up GitLab CI to automatically push CE master changes into EE master, or revert them if the changes cause merge conflicts. The CI configuration contains a single job to do this: `merge:master`. This job is executed for every push to master, and periodically using a CI schedule. The periodic job is necessary because incremental jobs may not be able to revert commits if newly added commits depend on these commits. By re-running the job periodically (including all changes since a large enough time frame), we can ensure that such commits are also reverted (if they still conflict at that time). The job runs in its own "merge" stage, _after_ the build and prepare stages, but _before_ running the tests. This ensures that randomly failing tests won't prevent code from being merged into EE. Running the stage after the "prepare" stage reduces the chances of the job reverting CE changes just because it ran before a corresponding EE MR was merged into EE master.
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml24
1 files changed, 24 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 79ec1b881d4..0a8e0201c4b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -48,6 +48,7 @@ after_script:
stages:
- build
- prepare
+ - merge
- test
- post-test
- pages
@@ -1025,3 +1026,26 @@ schedule:review-cleanup:
- gem install gitlab --no-document
script:
- ruby -rrubygems scripts/review_apps/automated_cleanup.rb
+
+merge:master:
+ image: registry.gitlab.com/gitlab-org/merge-train
+ stage: merge
+ # The global before_script/after_script blocks break this job, or aren't
+ # necessary. These two lines result in them being ignored.
+ before_script: []
+ after_script: []
+ only:
+ refs:
+ - master
+ - schedules
+ variables:
+ - $CI_PROJECT_PATH == "gitlab-org/gitlab-ce"
+ - $MERGE_TRAIN_SSH_PUBLIC_KEY
+ - $MERGE_TRAIN_SSH_PRIVATE_KEY
+ - $MERGE_TRAIN_API_TOKEN
+ script:
+ - scripts/merge-train
+ cache:
+ paths:
+ - gitlab-ee
+ key: "merge:master"