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 2, 2024
1 parent 2e4cdf7 commit fa78f32
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 113 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 @@ -28,14 +27,14 @@ def compose
add_steps(find_checks(:default))
add_steps(find_checks(:pre_upgrade))
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 @@ -46,7 +45,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 @@ -56,7 +55,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 @@ -76,7 +75,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 @@ -89,7 +88,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
100 changes: 0 additions & 100 deletions definitions/scenarios/upgrade_to_capsule_6_16.rb

This file was deleted.

0 comments on commit fa78f32

Please sign in to comment.