Skip to content

Commit

Permalink
Add critical cmd migration
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmelt committed Oct 17, 2024
1 parent 6c374a4 commit 505c17e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions openc3/lib/openc3/migrations/20241016000000_scope_critical_cmd.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
require 'openc3/utilities/migration'
require 'openc3/models/scope_model'

module OpenC3
class ScopeCriticalCmd < Migration
def self.run
ScopeModel.names.each do |scope|
scope_model = ScopeModel.get_model(name: scope)
parent = "#{scope}__SCOPEMULTI__#{scope}"
scope_model.deploy_critical_cmd_microservice("/notexist", {}, parent)
microservice_model = MicroserviceModel.get_model(name: parent, scope: scope)
microservice_model.cmd << "#{scope}__CRITICALCMD__#{scope}"
microservice_model.update
end
end
end
end

unless ENV['OPENC3_NO_MIGRATE']
OpenC3::ScopeCriticalCmd.run
end

0 comments on commit 505c17e

Please sign in to comment.