Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine Satellite and Capsule into a single scenario #842

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions definitions/procedures/installer/upgrade_rake_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ module Procedures::Installer
class UpgradeRakeTask < ForemanMaintain::Procedure
metadata do
description 'Execute upgrade:run rake task'
confine do
feature(:satellite)
end
end

def run
# only run this in the Satellite scenario, as in others
# the installer runs this rake task for us already
execute!('foreman-rake upgrade:run') if feature(:satellite)
execute!('foreman-rake upgrade:run')
end
end
end
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
module Scenarios::Satellite_6_16
module Scenarios::Satellite
class Abstract < ForemanMaintain::Scenario
def self.upgrade_metadata(&block)
metadata do
tags :upgrade_scenario
confine do
feature(:satellite) &&
(feature(:satellite).current_minor_version == '6.15' || \
(feature(:downstream).current_minor_version == '6.15' || \
ForemanMaintain.upgrade_in_progress == '6.16')
end
instance_eval(&block)
Expand All @@ -19,7 +18,7 @@ def target_version

class PreUpgradeCheck < Abstract
upgrade_metadata do
description 'Checks before upgrading to Satellite 6.16'
description 'Checks before upgrading'
tags :pre_upgrade_checks
run_strategy :fail_slow
end
Expand All @@ -29,14 +28,14 @@ def compose
add_steps(find_checks(:pre_upgrade))
add_step(Checks::CheckIpv6Disable)
add_step(Checks::Disk::AvailableSpacePostgresql13)
add_step(Checks::Repositories::Validate.new(:version => '6.16'))
add_step(Checks::Repositories::Validate.new(:version => target_version))
add_step(Checks::CheckOrganizationContentAccessMode)
end
end

class PreMigrations < Abstract
upgrade_metadata do
description 'Procedures before migrating to Satellite 6.16'
description 'Procedures before migrating'
tags :pre_migrations
end

Expand All @@ -47,7 +46,7 @@ def compose

class Migrations < Abstract
upgrade_metadata do
description 'Migration scripts to Satellite 6.16'
description 'Migration scripts'
tags :migrations
run_strategy :fail_fast
end
Expand All @@ -57,7 +56,7 @@ def set_context_mapping
end

def compose
add_step(Procedures::Repositories::Setup.new(:version => '6.16'))
add_step(Procedures::Repositories::Setup.new(:version => target_version))
if el8?
modules_to_switch = ['postgresql:13']
add_step(Procedures::Packages::SwitchModules.new(:module_names => modules_to_switch))
Expand All @@ -77,7 +76,7 @@ def compose

class PostMigrations < Abstract
upgrade_metadata do
description 'Procedures after migrating to Satellite 6.16'
description 'Procedures after migrating'
tags :post_migrations
end

Expand All @@ -90,7 +89,7 @@ def compose

class PostUpgradeChecks < Abstract
upgrade_metadata do
description 'Checks after upgrading to Satellite 6.16'
description 'Checks after upgrading'
tags :post_upgrade_checks
run_strategy :fail_slow
end
Expand Down
102 changes: 0 additions & 102 deletions definitions/scenarios/upgrade_to_capsule_6_16.rb

This file was deleted.

Loading