flip dependencies for triggered/controlled services
Instead of treating the trigger as the "main" service and the triggered service as subsidary, now we treat the triggered service as the service and the trigger as "subsidary". This needs some special handling when we work out which services go in the default bundle, but it works better for declaring dependencies on triggered services because it means the dependency runs after the triggered service comes up, not just when the watcher-for-events starts
This commit is contained in:
@@ -11,7 +11,7 @@ test -n "$contents" && for d in $contents; do
|
||||
touch $out/${name}/contents.d/$d
|
||||
done
|
||||
|
||||
for i in timeout-up timeout-down run notification-fd up down finish consumer-for producer-for pipeline-name restart-on-upgrade; do
|
||||
for i in controllerName timeout-up timeout-down run notification-fd up down finish consumer-for producer-for pipeline-name restart-on-upgrade; do
|
||||
test -n "$(printenv $i)" && (echo "$(printenv $i)" > $out/${name}/$i)
|
||||
done
|
||||
|
||||
|
@@ -39,6 +39,7 @@ let
|
||||
, contents ? []
|
||||
, buildInputs ? []
|
||||
, isTrigger ? false
|
||||
, controller ? null
|
||||
} @ args:
|
||||
stdenvNoCC.mkDerivation {
|
||||
# we use stdenvNoCC to avoid generating derivations with names
|
||||
@@ -46,9 +47,11 @@ let
|
||||
inherit name serviceType up down run finish notification-fd
|
||||
producer-for consumer-for pipeline-name timeout-up timeout-down;
|
||||
restart-on-upgrade = isTrigger;
|
||||
buildInputs = buildInputs ++ dependencies ++ contents;
|
||||
buildInputs = buildInputs ++ dependencies ++ contents ++ lib.optional (controller != null) controller;
|
||||
dependencies = map (d: d.name) dependencies;
|
||||
contents = map (d: d.name) contents;
|
||||
inherit controller;
|
||||
controllerName = if controller ? name then controller.name else null;
|
||||
builder = ./builder.sh;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user