Skip to content
Snippets Groups Projects
Commit 47729eca authored by Marin Jankovski's avatar Marin Jankovski
Browse files

Merge branch '726-bump-omnibus-ctl' into 'master'

Bump omnibus-ctl version to 0.5.0

Closes #726

See merge request !1643
parents 82bcc5c5 2b76289c
No related branches found
No related tags found
1 merge request!1643Bump omnibus-ctl version to 0.5.0
Loading
Loading
@@ -9,6 +9,7 @@ omnibus-gitlab repository.
- Remove software definition of expat 59c39870
- Bump gitlab-elasticsearch-indexer version to 0.2.0 bba8edd3
- Adjust various default values for PostgreSQL based on GitLab.com
- Bump omnibus-ctl version to 0.5.0
 
9.3.3
 
Loading
Loading
diff --git a/lib/omnibus-ctl.rb b/lib/omnibus-ctl.rb
index b3e06c2..acbf8b9 100644
--- a/lib/omnibus-ctl.rb
+++ b/lib/omnibus-ctl.rb
@@ -504,7 +504,6 @@ EOM
# args being passed to this command does not include the ones that are
# starting with "-". See #is_option? method. If it is starting with "-"
# then it is treated as a option and we need to look for them in ARGV.
- check_license_acceptance(ARGV.include?("--accept-license"))
status = run_chef("#{base_path}/embedded/cookbooks/dna.json")
if status.success?
Loading
Loading
@@ -15,7 +15,7 @@
#
 
name 'omnibus-ctl'
default_version '0.3.6'
default_version 'v0.5.0'
 
license 'Apache-2.0'
license_file 'https://github.com/chef/omnibus-ctl/blob/master/LICENSE'
Loading
Loading
@@ -30,6 +30,7 @@ relative_path 'omnibus-ctl'
 
build do
env = with_standard_compiler_flags(with_embedded_path)
patch source: 'skip-license-acceptance.patch'
 
# Remove existing built gems in case they exist in the current dir
delete 'omnibus-ctl-*.gem'
Loading
Loading
Loading
Loading
@@ -24,7 +24,7 @@ class ReplicateGeoHelpers
 
unless ctl.service_enabled?('postgresql')
puts 'There is no PostgreSQL instance enabled in omnibus, exiting...'.color(:red)
exit! 1
Kernel.exit 1
end
 
puts
Loading
Loading
Loading
Loading
@@ -20,14 +20,14 @@ add_command_under_category 'set-geo-primary-node', 'gitlab-geo', 'Make this node
 
unless service_enabled?(service_name)
log 'unicorn is not enabled, exiting...'
exit! 1
Kernel.exit 1
end
 
ssh_file_path = path || '/var/opt/gitlab/.ssh/id_rsa.pub'
 
unless File.exist?(ssh_file_path)
log "Didn't find #{ssh_file_path}, please supply the path to the Geo SSH public key, e.g.: gitlab-ctl add-geo-primary-node /path/to/id_rsa.pub"
exit! 1
Kernel.exit 1
end
 
command = "gitlab-rake geo:set_primary_node[#{ssh_file_path}]"
Loading
Loading
Loading
Loading
@@ -21,12 +21,12 @@ add_command 'diff-config', 'Compare the user configuration with package availabl
 
unless File.exist?(user_config_file)
puts "Could not find '/etc/gitlab/gitlab.rb' configuration file. Did you run 'sudo gitlab-ctl reconfigure'?"
exit! 1
Kernel.exit 1
end
 
unless File.exist?(config_template_file)
puts "Could not find '/opt/gitlab/etc/gitlab.rb.template' template file. Is your package installed correctly?"
exit! 1
Kernel.exit 1
end
 
command = %W( #{base_path}/embedded/bin/git
Loading
Loading
Loading
Loading
@@ -23,7 +23,7 @@ INST_DIR = "#{base_path}/embedded/postgresql".freeze
add_command_under_category 'revert-pg-upgrade', 'database',
'Run this to revert to the previous version of the database',
2 do |_cmd_name|
@db_worker = GitlabCtl::PgUpgrade.new(base_path, data_path, parse_options[:tmp_dir])
@db_worker = GitlabCtl::PgUpgrade.new(base_path, data_path, parse_gitlab_options[:tmp_dir])
 
maintenance_mode('enable')
 
Loading
Loading
@@ -31,7 +31,7 @@ add_command_under_category 'revert-pg-upgrade', 'database',
@db_worker.fetch_running_version == default_version
end
log "Already running #{default_version}"
exit! 1
Kernel.exit 1
end
 
unless Dir.exist?("#{@db_worker.tmp_data_dir}.#{default_version}")
Loading
Loading
@@ -48,7 +48,7 @@ add_command_under_category 'revert-pg-upgrade', 'database',
sleep 5
rescue Interrupt
log 'Received interrupt, not doing anything'
exit! 0
Kernel.exit 0
end
revert
maintenance_mode('disable')
Loading
Loading
@@ -57,7 +57,7 @@ end
add_command_under_category 'pg-upgrade', 'database',
'Upgrade the PostgreSQL DB to the latest supported version',
2 do |_cmd_name|
@db_worker = GitlabCtl::PgUpgrade.new(base_path, data_path, parse_options[:tmp_dir])
@db_worker = GitlabCtl::PgUpgrade.new(base_path, data_path, parse_gitlab_options[:tmp_dir])
 
running_version = @db_worker.fetch_running_version
 
Loading
Loading
@@ -67,14 +67,14 @@ add_command_under_category 'pg-upgrade', 'database',
get_all_services.member?('postgresql')
end
$stderr.puts 'No currently installed postgresql in the omnibus instance found.'
exit! 0
Kernel.exit 0
end
 
if progress_message('Checking if we already upgraded') do
running_version == upgrade_version
end
$stderr.puts "The latest version #{upgrade_version} is already running, nothing to do"
exit! 0
Kernel.exit 0
end
 
if progress_message(
Loading
Loading
@@ -85,7 +85,7 @@ add_command_under_category 'pg-upgrade', 'database',
log "Upgrading PostgreSQL to #{upgrade_version}"
else
$stderr.puts 'No new version of PostgreSQL installed, nothing to upgrade to'
exit! 1
Kernel.exit 1
end
 
unless progress_message(
Loading
Loading
@@ -97,7 +97,7 @@ add_command_under_category 'pg-upgrade', 'database',
end
end
log "#{link} is not linked to #{bin_file}, unable to proceed with non-standard installation"
exit! 1
Kernel.exit 1
end
 
# All tests have passed, this should be an upgradable instance.
Loading
Loading
@@ -105,7 +105,7 @@ add_command_under_category 'pg-upgrade', 'database',
 
# Wait for processes to settle, and give use one last chance to change their
# mind
delay_for(30) if parse_options[:wait]
delay_for(30) if parse_gitlab_options[:wait]
 
# Get the existing locale before we move on
begin
Loading
Loading
@@ -227,10 +227,10 @@ add_command_under_category 'pg-upgrade', 'database',
log 'Please verify everything is working and run the following if so'
log "rm -rf #{@db_worker.tmp_data_dir}.#{default_version}"
maintenance_mode('disable')
exit! 0
Kernel.exit 0
end
 
def parse_options
def parse_gitlab_options
options = {
tmp_dir: nil,
wait: true
Loading
Loading
@@ -342,5 +342,5 @@ def delay_for(seconds)
rescue Interrupt
log "\nInterrupt received, cancelling upgrade"
maintenance_mode('disable')
exit! 0
Kernel.exit 0
end
Loading
Loading
@@ -20,14 +20,14 @@ add_command_under_category 'registry-garbage-collect', 'container-registry', 'Ru
 
unless service_enabled?(service_name)
log "Container registry is not enabled, exiting..."
exit! 1
Kernel.exit 1
end
 
config_file_path = path || '/var/opt/gitlab/registry/config.yml'
 
unless File.exist?(config_file_path)
log "Didn't find #{config_file_path}, please supply the path to registry config.yml file, eg: gitlab-ctl registry-garbage-collect /path/to/config.yml"
exit! 1
Kernel.exit 1
end
 
run_sv_command_for_service('stop', service_name)
Loading
Loading
@@ -36,10 +36,10 @@ add_command_under_category 'registry-garbage-collect', 'container-registry', 'Ru
 
if status.exitstatus.zero?
run_sv_command_for_service('start', service_name)
exit! 0
Kernel.exit 0
else
log "\nFailed to run garbage-collect command, starting registry service."
run_sv_command_for_service('start', service_name)
exit! 1
Kernel.exit 1
end
end
Loading
Loading
@@ -23,5 +23,5 @@ add_command "remove-accounts", "Delete *all* users and groups used by this packa
 
status = run_command(command.join(" "))
remove_old_node_state
exit! 1 unless status.success?
Kernel.exit 1 unless status.success?
end
Loading
Loading
@@ -21,7 +21,7 @@ add_command 'upgrade', 'Run migrations after a package upgrade', 1 do |cmd_name|
if /: runsv not running/ =~ service_statuses || service_statuses.empty?
log 'It looks like GitLab has not been configured yet; skipping the upgrade '\
'script.'
exit! 0
Kernel.exit 0
end
 
unless progress_message('Checking PostgreSQL executables') do
Loading
Loading
@@ -40,7 +40,7 @@ add_command 'upgrade', 'Run migrations after a package upgrade', 1 do |cmd_name|
auto_migrations_skip_file = "#{etc_path}/skip-auto-migrations"
if File.exist?(auto_migrations_skip_file)
log "Found #{auto_migrations_skip_file}, exiting..."
exit! 0
Kernel.exit 0
end
 
log 'Shutting down all GitLab services except those needed for migrations'
Loading
Loading
@@ -97,7 +97,7 @@ add_command 'upgrade', 'Run migrations after a package upgrade', 1 do |cmd_name|
status.success?
end
log 'Error ensuring PostgreSQL is updated. Please check the logs'
exit! 1
Kernel.exit 1
end
 
log 'Restarting previously running GitLab services'
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment