Maven migration (first draft)
This commit is contained in:
parent
da79ac3e1d
commit
fee48b0b50
1711 changed files with 662 additions and 0 deletions
52
legacy/utilities/releaseScripts/2_create_branches.rb
Normal file
52
legacy/utilities/releaseScripts/2_create_branches.rb
Normal file
|
@ -0,0 +1,52 @@
|
|||
=begin
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Get the branch name.
|
||||
|
||||
If either repository already contains the branch, complain.
|
||||
|
||||
Otherwise, pull develop to the latest commit and create the branches. Don't push.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
--------------------------------------------------------------------------------
|
||||
=end
|
||||
|
||||
$: << File.dirname(File.expand_path(__FILE__))
|
||||
require '_common'
|
||||
|
||||
#
|
||||
# Create a branch by this name in this repository.
|
||||
#
|
||||
def create_branch(dir, branch)
|
||||
Dir.chdir(dir) do |path|
|
||||
approve_and_execute([
|
||||
"git checkout develop",
|
||||
"git pull",
|
||||
"git checkout -b #{branch}"
|
||||
], "in #{path}")
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
# ------------------------------------------------------------------------------------
|
||||
# Main method
|
||||
# ------------------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
begin
|
||||
branch = Settings.branch_name
|
||||
vivo_path = Settings.vivo_path
|
||||
vitro_path = Settings.vitro_path
|
||||
|
||||
raise BadState.new("Branches are not created for test candidates.") if is_test_candidate?()
|
||||
raise BadState.new("Branch #{branch} already exists in VIVO.") if branch_exists?(vivo_path, branch)
|
||||
raise BadState.new("Branch #{branch} already exists in Vitro.") if branch_exists?(vitro_path, branch)
|
||||
|
||||
get_permission_and_go("OK to create branches named '#{branch}'?") do
|
||||
puts "Creating branches"
|
||||
create_branch(vivo_path, branch)
|
||||
create_branch(vitro_path, branch)
|
||||
end
|
||||
rescue BadState
|
||||
puts "#{$!.message} - Aborting."
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue