Commit 7650e4de authored by Lin Jen-Shin's avatar Lin Jen-Shin

Add a CI job to test ce-upgrade-ee migration path

We're not trying to reuse the commands here because:

* Avoid touching CE tasks
* Allow them to evolve independently if needed
* It's nice to have highlighted command lines history
parent 0d7352c2
......@@ -338,6 +338,25 @@ stages:
- date
- bundle exec rake db:migrate
.migration-paths-upgrade-ce-to-ee: &migration-paths-upgrade-ce-to-ee
<<: *dedicated-no-docs-and-no-qa-pull-cache-job
variables:
CREATE_DB_USER: "true"
script:
- CE_HEAD=$(ruby -r./scripts/ee_specific_check/ee_specific_check -e'puts EESpecificCheck.fetch_remote_ce_branch')
- git checkout -f $CE_HEAD
- bundle install $BUNDLE_INSTALL_FLAGS
- date
- cp config/gitlab.yml.example config/gitlab.yml
- bundle exec rake db:drop db:create db:schema:load db:seed_fu
- date
- git checkout $CI_COMMIT_SHA
- bundle install $BUNDLE_INSTALL_FLAGS
- date
- . scripts/prepare_build.sh
- date
- bundle exec rake db:migrate
##
# Trigger a package build in omnibus-gitlab repository
#
......@@ -738,6 +757,14 @@ migration:path-mysql:
<<: *migration-paths
<<: *use-mysql
migration:upgrade-pg-ce-to-ee:
<<: *migration-paths-upgrade-ce-to-ee
<<: *use-pg
migration:upgrade-mysql-ce-to-ee:
<<: *migration-paths-upgrade-ce-to-ee
<<: *use-mysql
.db-rollback: &db-rollback
<<: *dedicated-no-docs-and-no-qa-pull-cache-job
script:
......
......@@ -23,14 +23,12 @@ module EESpecificCheck
end
def say(message)
puts "\n#{message}", "\n" # puts would eat trailing newline
warn "\n#{message}", "\n" # puts would eat trailing newline
end
def find_compare_base
git_clean
setup_canonical_remotes
ce_fetch_head = fetch_remote_ce_branch
ce_fetch_base = run_git_command("merge-base canonical-ce/master #{ce_fetch_head}")
ce_merge_base = run_git_command("merge-base canonical-ce/master canonical-ee/master")
......@@ -57,6 +55,8 @@ module EESpecificCheck
end
def fetch_remote_ce_branch
setup_canonical_remotes
remote_to_fetch, branch_to_fetch = find_remote_ce_branch
run_git_command("fetch #{remote_to_fetch} #{branch_to_fetch} --quiet")
......@@ -220,7 +220,7 @@ module EESpecificCheck
def run_command(*commands)
commands.map do |cmd|
puts "=> Running `#{cmd}`"
warn "=> Running `#{cmd}`"
`#{cmd}`.strip
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment