dependencies
This commit is contained in:
parent
58330f77e8
commit
2496e349cb
1 changed files with 11 additions and 1 deletions
|
@ -13,9 +13,17 @@ local env_string = ""
|
|||
local netns_string = ""
|
||||
local USE_NETNS = os.getenv "USE_NETNS"
|
||||
if USE_NETNS ~= nil then
|
||||
env_string = env_string .. "USE_NETNS='"..USE_NETNS.."' "
|
||||
env_string = env_string .. "USE_NETNS="..USE_NETNS.." "
|
||||
netns_string = "ip netns exec "..USE_NETNS.." "
|
||||
end
|
||||
local dependencies_string = ""
|
||||
local DEPENDENCIES = os.getenv "DEPENDENCIES"
|
||||
if DEPENDENCIES ~= nil then
|
||||
env_string = env_string .. "DEPENDENCIES='"..DEPENDENCIES.."' "
|
||||
for dep in string.gmatch(DEPENDENCIES, "[%w-]+") do
|
||||
dependencies_string = dependencies_string .. "sv status "..dep.." || exit 1\n"
|
||||
end
|
||||
end
|
||||
|
||||
local user = arg[1]
|
||||
local container_name = arg[2]
|
||||
|
@ -30,6 +38,8 @@ local prefix = [[
|
|||
#!/bin/sh
|
||||
# Generated with ]]..utils.join_table({env_string..arg[0], user, container_name, image_name, unpack(arguments)}, " ")..[[
|
||||
|
||||
]]..dependencies_string..[[
|
||||
|
||||
IMAGE=']]..image_name..[['
|
||||
|
||||
CONTAINER_NAME=']]..container_name..[['
|
||||
|
|
Loading…
Reference in a new issue