VIVO-272 Do proper merge and tag of the final release
This commit is contained in:
parent
f72913a2f1
commit
8ed2523a7d
2 changed files with 21 additions and 16 deletions
|
@ -23,7 +23,7 @@ require '_common'
|
||||||
#
|
#
|
||||||
def export_files(vivo_path, vitro_path, tag, export_dir)
|
def export_files(vivo_path, vitro_path, tag, export_dir)
|
||||||
approve_and_execute([
|
approve_and_execute([
|
||||||
"rm -Rf #{export_dir}/..",
|
"rm -Rf #{File.expand_path("..", export_dir)}",
|
||||||
"mkdir -pv #{export_dir}",
|
"mkdir -pv #{export_dir}",
|
||||||
"cp -R #{vivo_path}/* #{export_dir}",
|
"cp -R #{vivo_path}/* #{export_dir}",
|
||||||
"mkdir -pv #{export_dir}/vitro-core",
|
"mkdir -pv #{export_dir}/vitro-core",
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
=begin
|
=begin
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
Merge the new tags into the master branches.
|
Merge the maintenance branches into the master branchs, and create the final
|
||||||
|
release tags.
|
||||||
|
|
||||||
This will only work if the tag is present, and if the release candidate is "final".
|
This will only work if the release candidate is "final", and if the maintenance
|
||||||
|
branches already exist.
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
@ -13,14 +15,17 @@ $: << File.dirname(File.expand_path(__FILE__))
|
||||||
require '_common'
|
require '_common'
|
||||||
|
|
||||||
#
|
#
|
||||||
# Merge the tag to the master branch.
|
# Merge the maintenance branch to the master branch and create the tag.
|
||||||
#
|
#
|
||||||
def merge_tag_to_master(tag, repo_path)
|
def merge_branch_to_master(branch, tag, message, repo_path)
|
||||||
Dir.chdir(repo_path) do |path|
|
Dir.chdir(repo_path) do |path|
|
||||||
approve_and_execute([
|
cmds = [
|
||||||
"git checkout master",
|
"git checkout master",
|
||||||
"git merge #{tag}"
|
"git merge --no-ff -Xtheirs #{branch}",
|
||||||
])
|
"git tag -a -f #{tag} -m '#{message}'"
|
||||||
|
]
|
||||||
|
cmds.insert(0, "git branch master origin/master") if `git branch --list master`.strip.empty?
|
||||||
|
approve_and_execute(cmds, "in #{path}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -31,24 +36,24 @@ end
|
||||||
#
|
#
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
branch = Settings.branch_name
|
||||||
candidate_label = Settings.confirm_candidate_label(Settings.candidate_label)
|
candidate_label = Settings.confirm_candidate_label(Settings.candidate_label)
|
||||||
tag = Settings.tag_name
|
tag = Settings.tag_name
|
||||||
|
message = Settings.tag_message
|
||||||
vivo_path = Settings.vivo_path
|
vivo_path = Settings.vivo_path
|
||||||
vitro_path = Settings.vitro_path
|
vitro_path = Settings.vitro_path
|
||||||
|
|
||||||
raise BadState.new("Only the final release gets merged to the master branch.") unless candidate_label == "final"
|
raise BadState.new("Only the final release gets merged to the master branch.") unless candidate_label == "final"
|
||||||
raise BadState.new("Tag #{tag} doesn't exist in VIVO.") unless tag_exists?(vivo_path, tag)
|
raise BadState.new("Branch #{branch} doesn't exist in VIVO.") unless branch_exists?(vivo_path, branch)
|
||||||
raise BadState.new("Tag #{tag} doesn't exist in Vitro.") unless tag_exists?(vitro_path, tag)
|
raise BadState.new("Branch #{branch} doesn't exist in Vitro.") unless branch_exists?(vitro_path, branch)
|
||||||
raise BadState.new("Tag has already been merged to master branch in VIVO." if tag_commit(tag, vivo_path) == master_commit(vivo_path)
|
|
||||||
raise BadState.new("Tag has already been merged to master branch in Vitro." if tag_commit(tag, vitro_path) == master_commit(vitro_path)
|
|
||||||
|
|
||||||
puts
|
puts
|
||||||
yn = prompt("OK to merge the #{tag} tags to the master branches? (y/n)")
|
yn = prompt("OK to merge the #{tag} tags to the master branches? (y/n)")
|
||||||
if yn.downcase == 'y'
|
if yn.downcase == 'y'
|
||||||
puts
|
puts
|
||||||
puts "Merging tags"
|
puts "Merging tags"
|
||||||
merge_tag_to_master(tag, vivo_path)
|
merge_branch_to_master(branch, tag, message, vivo_path)
|
||||||
merge_tag_to_master(tag, vitro_path)
|
merge_branch_to_master(branch, tag, message, vitro_path)
|
||||||
puts
|
puts
|
||||||
else
|
else
|
||||||
puts
|
puts
|
||||||
|
|
Loading…
Add table
Reference in a new issue