Skip to content

Commit

Permalink
Combine Satellite and Capsule into a single scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed May 29, 2024
1 parent 27ae735 commit 8b7a8bb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 115 deletions.
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(:foreman)
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.

0 comments on commit 8b7a8bb

Please sign in to comment.