-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
installer: make sure we can always test the installer in ci and locally
Just now there is a dependency on cachix, which means we cannot test the installer in CI if forks do not have the necessary secrets set up. We replace this with a simple http server that serves the installer and can be both used in CI and locally.
- Loading branch information
Showing
5 changed files
with
83 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -euo pipefail | ||
|
||
script=$(nix-build -A outputs.hydraJobs.installerScriptForGHA --no-out-link) | ||
installerHash=$(echo "$script" | cut -b12-43 -) | ||
nix build -L ".#installerScriptForGHA" ".#binaryTarball" | ||
|
||
installerURL=https://$CACHIX_NAME.cachix.org/serve/$installerHash/install | ||
|
||
echo "::set-output name=installerURL::$installerURL" | ||
install -D ./result/install "out/install-$(nix eval --raw --impure --expr builtins.currentSystem)" | ||
name="$(basename "$(realpath ./result-1)")" | ||
# everything before the first dash | ||
cp -r ./result-1 "out/${name%%-*}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
if [[ ! -d out ]]; then | ||
echo "run prepare-installer-for-github-actions first" | ||
exit 1 | ||
fi | ||
cd out | ||
PORT=${PORT:-8126} | ||
nohup python -m http.server "$PORT" >/dev/null 2>&1 & | ||
pid=$! | ||
|
||
while ! curl -s "http://localhost:$PORT"; do | ||
sleep 1 | ||
if ! kill -0 $pid; then | ||
echo "Failed to start http server" | ||
exit 1 | ||
fi | ||
done | ||
system=$(nix eval --raw --impure --expr builtins.currentSystem) | ||
echo 'To install nix, run the following command:' | ||
echo "sh <(curl http://localhost:$PORT/install-$system) --tarball-url-prefix http://localhost:$PORT/" | ||
echo "::set-output system=$system" |