lib/hako/schedulers/ecs.rb in hako-2.4.0 vs lib/hako/schedulers/ecs.rb in hako-2.5.0
- old
+ new
@@ -153,11 +153,11 @@
end
task_definition = ecs_client.describe_task_definition(task_definition: current_service.task_definition).task_definition
current_definition = "#{task_definition.family}:#{task_definition.revision}"
target_definition = find_rollback_target(task_definition)
- Hako.logger.info "Current task defintion is #{current_definition}. Rolling back to #{target_definition}"
+ Hako.logger.info "Current task definition is #{current_definition}. Rolling back to #{target_definition}"
call_rollback_started(task_definition, target_definition)
if @dry_run
Hako.logger.info 'Deployment completed (dry-run)'
else
@@ -591,10 +591,11 @@
memory_reservation: container.memory_reservation,
links: container.links,
port_mappings: container.port_mappings,
essential: true,
environment: environment,
+ secrets: container.secrets,
docker_labels: container.docker_labels,
mount_points: container.mount_points,
command: container.command,
privileged: container.privileged,
linux_parameters: container.linux_parameters,
@@ -1193,9 +1194,17 @@
name = env.fetch(:name)
value = env.fetch(:value)
# additional_env (given in command line) has priority over env (declared in definition file)
unless additional_env.key?(name)
cmd << '--env' << "#{name}=#{value}"
+ cmd << "\\\n "
+ end
+ end
+ (definition[:secrets] || []).each do |secret|
+ name = secret.fetch(:name)
+ # additional_env (given in command line) has priority over secrets (declared in definition file)
+ unless additional_env.key?(name)
+ cmd << '--env' << "#{name}=secret:#{secret.fetch(:value_from)}"
cmd << "\\\n "
end
end
additional_env.each do |name, value|
cmd << '--env' << "#{name}=#{value}"