mirror of
https://gitlab.com/famedly/conduit.git
synced 2025-01-18 12:10:09 +00:00
Merge branch 'build-and-cache-everything' into 'next'
Draft: build and cache all packages and CI dependencies See merge request famedly/conduit!667
This commit is contained in:
commit
79c4bb17ca
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
@ -17,15 +17,24 @@ if [ ! -z ${ATTIC_TOKEN+x} ]; then
|
|||||||
"${ATTIC_ENDPOINT:-https://attic.conduit.rs/conduit}" \
|
"${ATTIC_ENDPOINT:-https://attic.conduit.rs/conduit}" \
|
||||||
"$ATTIC_TOKEN"
|
"$ATTIC_TOKEN"
|
||||||
|
|
||||||
readarray -t outputs < <(nix path-info "$@")
|
|
||||||
readarray -t derivations < <(nix path-info "$@" --derivation)
|
readarray -t derivations < <(nix path-info "$@" --derivation)
|
||||||
|
for derivation in "${derivations[@]}"; do
|
||||||
|
cache+=(
|
||||||
|
"$(nix-store --query --requisites --include-outputs "$derivation")"
|
||||||
|
)
|
||||||
|
done
|
||||||
|
|
||||||
|
# Upload them to Attic
|
||||||
|
#
|
||||||
|
# Use `xargs` and a here-string because something would probably explode if
|
||||||
|
# several thousand arguments got passed to a command at once. Hopefully no
|
||||||
|
# store paths include a newline in them.
|
||||||
|
(
|
||||||
|
IFS=$'\n'
|
||||||
|
nix shell --inputs-from . attic -c xargs \
|
||||||
|
attic push conduit <<< "${cache[*]}"
|
||||||
|
)
|
||||||
|
|
||||||
# Push the target installable and its build dependencies
|
|
||||||
nix run --inputs-from . attic -- \
|
|
||||||
push \
|
|
||||||
conduit \
|
|
||||||
"${outputs[@]}" \
|
|
||||||
"${derivations[@]}"
|
|
||||||
else
|
else
|
||||||
echo "\$ATTIC_TOKEN is unset, skipping uploading to the binary cache"
|
echo "\$ATTIC_TOKEN is unset, skipping uploading to the binary cache"
|
||||||
fi
|
fi
|
||||||
|
@ -36,8 +36,7 @@ let
|
|||||||
});
|
});
|
||||||
|
|
||||||
buildPackageEnv = {
|
buildPackageEnv = {
|
||||||
# Temporarily disabled, see https://gitlab.com/famedly/conduit/-/merge_requests/662#note_1892753424
|
CONDUIT_VERSION_EXTRA = inputs.self.shortRev or inputs.self.dirtyShortRev;
|
||||||
# CONDUIT_VERSION_EXTRA = inputs.self.shortRev or inputs.self.dirtyShortRev;
|
|
||||||
} // buildDepsOnlyEnv;
|
} // buildDepsOnlyEnv;
|
||||||
|
|
||||||
commonAttrs = {
|
commonAttrs = {
|
||||||
|
Loading…
Reference in New Issue
Block a user