Method: OpenC3::ScopeModel#deploy

Defined in:
lib/openc3/models/scope_model.rb

#deploy(gem_path, variables) ⇒ Object



325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# File 'lib/openc3/models/scope_model.rb', line 325

def deploy(gem_path, variables)
  seed_database()

  if ENTERPRISE
    # Create DEFAULT trigger group model
    model = TriggerGroupModel.get(name: 'DEFAULT', scope: @scope)
    unless model
      model = TriggerGroupModel.new(name: 'DEFAULT', shard: @shard, scope: @scope)
      model.create()
      model.deploy()
    end
  end

  # Create UNKNOWN target for display of unknown data
  model = TargetModel.new(name: "UNKNOWN", shard: @shard, scope: @scope)
  model.create

  @parent = "#{@scope}__SCOPEMULTI__#{@scope}"

  # OpenC3 Log Microservice
  deploy_openc3_log_messages_microservice(gem_path, variables, @parent)

  # UNKNOWN CommandLog Microservice
  deploy_unknown_commandlog_microservice(gem_path, variables, @parent)

  # UNKNOWN PacketLog Microservice
  deploy_unknown_packetlog_microservice(gem_path, variables, @parent)

  # Only DEFAULT scope
  if @scope == 'DEFAULT'
    # Periodic Microservice
    deploy_periodic_microservice(gem_path, variables, @parent)
  end

  # Scope Cleanup Microservice
  deploy_scopecleanup_microservice(gem_path, variables, @parent)

  if ENTERPRISE
    # Critical Cmd Microservice
    deploy_critical_cmd_microservice(gem_path, variables, @parent)
  end

  # Multi Microservice to parent other scope microservices
  deploy_scopemulti_microservice(gem_path, variables)
end