File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed
Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 5252 # path of this packages while keeping the extra details as a `jq` friendly
5353 # reference that are used to change it later appending the desired commit
5454 # (interchanging commits it's still an untested feature).
55- # For cloud runs references :
55+ # For "nomadcloud" runs workbench's `$WB_GITREV` is used as commit :
5656 # installable="${flakeReference}/${commit}#${flakeOutput}"
5757 installables =
5858 {
142142 {
143143 # Provided that all the "start.sh" scripts are taking it into account,
144144 # this packages could be configured to come from a different commit than
145- # the one used to enter the shell ??????????
145+ # the one used to enter the shell.
146146 cardano-node = rec {
147147 # Local reference only used if not "cloud".
148148 # Avoid rebuilding on every commit because of `set-git-rev`.
Original file line number Diff line number Diff line change @@ -334,8 +334,8 @@ allocate-run-nomadcloud() {
334334 # outputs it needs inside the container, these are built using the packages
335335 # metadata in "containerPkgs" and the current commit.
336336 local gitrev
337- gitrev=" $( git rev-parse HEAD ) "
338- msg $( blue " INFO: Found GitHub commit with ID \" $gitrev \" " )
337+ gitrev=" ${WB_GITREV :? " No WB_GITREV " } "
338+ msg $( blue " INFO: Found GitHub commit with ID \" $gitrev \" set on shell creation " )
339339 # Check if the Nix package was created from a dirty git tree
340340 if test " $gitrev " = " 0000000000000000000000000000000000000000"
341341 then
Original file line number Diff line number Diff line change 3838 # build plan as computed by nix
3939 nixPlanJson = cardanoNodeProject . plan-nix . json ;
4040
41+ # Optimize cache hits setting gitrev using bash once inside the shell.
4142 workbench-envars =
4243 ''
4344 export WB_CHAP_PATH=${ chap }
5051 export WB_DEPLOYMENT_NAME='' ${WB_DEPLOYMENT_NAME:-$(basename $(pwd))}
5152 export WB_MODULAR_GENESIS='' ${WB_MODULAR_GENESIS:-0}
5253 export WB_LOCLI_DB='' ${WB_LOCLI_DB:-1}
54+ if test -z "$(git status --porcelain --untracked-files=no)"
55+ then export WB_GITREV="$(git rev-parse HEAD)"
56+ else export WB_GITREV="0000000000000000000000000000000000000000"
57+ fi
5358 export CARDANO_NODE_SOCKET_PATH=${ stateDir } /node-0/node.socket
5459 ''
5560 + lib . optionalString ( profileBundle . profile . value . scenario == "chainsync" ) (
112117 gnused
113118 procps
114119 nix
115- git
120+ git # `workbench-envars` set the gitrev
116121 jq
117122 ]
118123 )
You can’t perform that action at this time.
0 commit comments