mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 12:29:19 -08:00
fix: gc not couple to cachix push
This commit is contained in:
parent
a4259bcbd0
commit
3bbd772495
1 changed files with 14 additions and 9 deletions
|
|
@ -27,7 +27,7 @@ init_nfargs() {
|
||||||
|
|
||||||
if [[ -n "${NF_ACTIONS_TEST_OUTLINK-}" || -n "${NF_UPDATE_CACHIX_PUSH-}" ]]; then
|
if [[ -n "${NF_ACTIONS_TEST_OUTLINK-}" || -n "${NF_UPDATE_CACHIX_PUSH-}" ]]; then
|
||||||
nfargs+=(
|
nfargs+=(
|
||||||
-o "${NF_ACTIONS_TEST_OUTLINK-result}$nflinksuffix"
|
-o "${NF_ACTIONS_TEST_OUTLINK-result}" "$nflinksuffix"
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
nfargs+=(
|
nfargs+=(
|
||||||
|
|
@ -36,13 +36,16 @@ init_nfargs() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
nfgc() {
|
perform_cachix_push() {
|
||||||
|
local nflinksuffix="-L"
|
||||||
|
if [[ -n ${NF_UPDATE_CACHIX_PUSH-} ]]; then
|
||||||
|
send_discord_message "Cachix pushing ${SYSTEM_TYPE} system build for ${ALIAS}"
|
||||||
|
cachix push kittywitch "./${NF_ACTIONS_TEST_OUTLINK-result}$nflinksuffix"*/
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
perform_garbage_collection() {
|
||||||
if [[ -n ${NF_ACTIONS_TEST_GC-} ]]; then
|
if [[ -n ${NF_ACTIONS_TEST_GC-} ]]; then
|
||||||
if [[ -n ${NF_UPDATE_CACHIX_PUSH-} ]]; then
|
|
||||||
send_discord_message "Cachix pushing ${SYSTEM_TYPE} system build for ${ALIAS}"
|
|
||||||
cachix push kittywitch "./${NF_ACTIONS_TEST_OUTLINK-result}$nflinksuffix"*/
|
|
||||||
rm -f "./${NF_ACTIONS_TEST_OUTLINK-result}$nflinksuffix"*
|
|
||||||
fi
|
|
||||||
nix-collect-garbage -d
|
nix-collect-garbage -d
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
@ -100,14 +103,16 @@ else
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
send_discord_message "${SYSTEM_TYPE} system build of ${ALIAS} succeeded!"
|
send_discord_message "${SYSTEM_TYPE} system build of ${ALIAS} succeeded!"
|
||||||
nfgc
|
perform_cachix_push
|
||||||
|
perform_garbage_collection
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n ${NF_ACTIONS_TEST_ASYNC-} ]]; then
|
if [[ -n ${NF_ACTIONS_TEST_ASYNC-} ]]; then
|
||||||
init_nfargs
|
init_nfargs
|
||||||
if nix build "${nfargs[@]}" "${NIX_BUILD_ARGS_ASYNC[@]}"; then
|
if nix build "${nfargs[@]}" "${NIX_BUILD_ARGS_ASYNC[@]}"; then
|
||||||
nfgc
|
perform_cachix_push
|
||||||
|
perform_garbage_collection
|
||||||
else
|
else
|
||||||
send_discord_message "Async build failure for ${nfsystem}, problem!"
|
send_discord_message "Async build failure for ${nfsystem}, problem!"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue