You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# TODO do this inside bashbrew? (could then use go-git to make an even more determistic tarball instead of munging Git afterwards, and could even do things like munge the Dockerfile to remove no-rebuild variance like comments and non-COPY-ed files)
sourceId: "printf \("%s\\n" | @sh) \"$reproducibleGitChecksum\" \(.File | @sh) \(.Builder | @sh) | _sha256", # the combination of things that might cause a rebuild # TODO consider making this a compressed JSON object like buildId
# https://github.com/jqlang/jq/issues/2063 - "stderr" cannot functionally output a string correctly until jq 1.7+ (which is very very recent), so we hack around it to get some progress output by using Bash to swap stdout and stderr so we can output our objects to stderr and our progress text to stdout and "fix it in post"
79
+
# TODO balk / error at multiple arches entries
80
+
first(.arches[].tags[], .arches[].archTags[]) as $tag
81
+
| first(.arches | keys_unsorted[]) as $arch
82
+
| stderr
83
+
| "\($tag) (\($arch)): \(.sourceId)"
84
+
# TODO if we could get jq 1.7+ for sure, we can drop this entire "jq" invocation and instead have the reduce loop of the following invocation print status strings directly to "stderr"
85
+
'| jq -n --argjson pins "$externalPinsJson"'
141
86
def unique_unsorted:
142
87
# https://unix.stackexchange.com/a/738744/153467
143
88
reduce .[] as $a ([]; if IN(.[]; $a) then . else . += [$a] end)
144
89
;
145
-
reduce .[] as $in ({};
146
-
.[$in.sourceId] |= (
90
+
reduce inputs as $in ({};
91
+
# TODO if we can get support for joining two arrays directly in bashbrew (sprig?) then we can avoid this .arches[] nonsense
0 commit comments