service: $SERVICE_ID is the long service id

master
Luka Vandervelden 2019-10-24 15:29:22 +02:00
parent 035420cc9a
commit 440fde06f8
1 changed files with 6 additions and 2 deletions

View File

@ -76,11 +76,15 @@ class Service
file.join("\n") + "\n" file.join("\n") + "\n"
end end
def full_id
"#{@environment.name}/#{name}"
end
def id def id
if @environment.name == "root" if @environment.name == "root"
name name
else else
"#{@environment.name}/#{name}" full_id
end end
end end
@ -113,7 +117,7 @@ class Service
private def build_environment private def build_environment
env = {} of String => String env = {} of String => String
env["SERVICE_ID"] = id env["SERVICE_ID"] = full_id
env["ENVIRONMENT"] = @environment.name env["ENVIRONMENT"] = @environment.name
env["ENVIRONMENT_TYPE"] = @environment.type.to_s env["ENVIRONMENT_TYPE"] = @environment.type.to_s