Method: OpenC3::InterfaceModel#deploy
- Defined in:
- lib/openc3/models/interface_model.rb
#deploy(gem_path, variables, validate_only: false) ⇒ Object
Creates a MicroserviceModel to deploy the Interface/Router
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 |
# File 'lib/openc3/models/interface_model.rb', line 347 def deploy(gem_path, variables, validate_only: false) type = self.class._get_type microservice_name = "#{@scope}__#{type}__#{@name}" microservice = MicroserviceModel.new( name: microservice_name, work_dir: @work_dir, cmd: @cmd, env: @env, ports: @ports, container: @container, target_names: @target_names, plugin: @plugin, needs_dependencies: @needs_dependencies, secrets: @secrets, prefix: @prefix, scope: @scope ) unless validate_only @target_names.each { |target_name| ensure_target_exists(target_name) } microservice.create microservice.deploy(gem_path, variables) ConfigTopic.write({ kind: 'created', type: type.downcase, name: @name, plugin: @plugin }, scope: @scope) Logger.info "Configured #{type.downcase} microservice #{microservice_name}" end microservice end |