mirror of
https://github.com/NixOS/nix
synced 2025-06-24 09:41:15 +02:00
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.
22 lines
504 B
Bash
Executable file
22 lines
504 B
Bash
Executable file
#!/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
|
|
|
|
echo 'To install nix, run the following command:'
|
|
echo "sh <(curl http://localhost:$PORT/install) --tarball-url-prefix http://localhost:$PORT"
|