builder.sh (1269B)
1 source $stdenv/setup 2 mkdir -p $out/${name} 3 4 writepath(){ 5 mkdir -p $(dirname $1) 6 if test -n "$2" ; then ( echo $2 > $1 ) ;fi 7 } 8 if test -n "$propertiesText"; then 9 mkdir $out/.properties 10 ( cd $out/.properties; eval "$propertiesText" ) 11 fi 12 13 echo $serviceType > $out/${name}/type 14 mkdir -p $out/${name}/dependencies.d 15 echo $buildInputs > $out/buildInputs 16 test -n "$dependencies" && for path in $dependencies; do 17 d=$(dirname $(cd ${path} && ls -d */type)) 18 touch $out/${name}/dependencies.d/$d 19 done 20 test -n "$contents" && for path in $contents; do 21 d=$(dirname $(cd ${path} && ls -d */type)) 22 mkdir -p $out/${name}/contents.d 23 touch $out/${name}/contents.d/$d 24 done 25 26 if test -n "$controller" ; then 27 d=$(dirname $(cd ${controller} && ls -d */type)) 28 echo "$d)" > $out/${name}/controller 29 # ^ why is there a closing paren here? 30 touch $out/${name}/dependencies.d/controlled 31 fi 32 33 for i in timeout-up timeout-down run notification-fd up down finish consumer-for producer-for pipeline-name restart-on-upgrade; do 34 test -n "$(printenv $i)" && (echo "$(printenv $i)" > $out/${name}/$i) 35 done 36 37 ( cd $out && ln -s /run/services/outputs/${name} ./.outputs ) 38 for i in $out/${name}/{down,up,run} ; do test -f $i && chmod +x $i; done 39 true