fix: gite nix runners
This commit is contained in:
@@ -68,7 +68,7 @@ let
|
||||
text = ''
|
||||
: "''${GCR_LISTEN_ADDR:=127.0.0.1}"
|
||||
: "''${GCR_LISTEN_PORT:=8787}"
|
||||
exec ${socat}/bin/socat -T5 -t5 \
|
||||
exec ${socat}/bin/socat -T120 -t120 \
|
||||
"TCP-LISTEN:$GCR_LISTEN_PORT,bind=$GCR_LISTEN_ADDR,reuseaddr,fork" \
|
||||
EXEC:"${handler}/bin/gcr-webhook-handler",pipes
|
||||
'';
|
||||
|
||||
@@ -284,7 +284,7 @@ case "$label" in
|
||||
nix|gross-nix-x86|gross-nix-arm|gross-nix-x86-perf|gross-nix-mixed-econ)
|
||||
nix_arch=""
|
||||
nix_sha=""
|
||||
case "$(uname -m)" in
|
||||
case "\$(uname -m)" in
|
||||
x86_64)
|
||||
nix_arch=x86_64-linux
|
||||
nix_sha="$GCR_NIX_TARBALL_SHA256"
|
||||
@@ -298,15 +298,22 @@ case "$label" in
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
curl -fsSL "https://releases.nixos.org/nix/nix-$GCR_NIX_VERSION/nix-$GCR_NIX_VERSION-$nix_arch.tar.xz" -o /tmp/nix.tar.xz
|
||||
printf '%s /tmp/nix.tar.xz\n' "$nix_sha" | sha256sum -c -
|
||||
curl -fsSL "https://releases.nixos.org/nix/nix-$GCR_NIX_VERSION/nix-$GCR_NIX_VERSION-\$nix_arch.tar.xz" -o /tmp/nix.tar.xz
|
||||
printf '%s /tmp/nix.tar.xz\n' "\$nix_sha" | sha256sum -c -
|
||||
tar -xJf /tmp/nix.tar.xz -C /tmp
|
||||
/tmp/nix-$GCR_NIX_VERSION-$nix_arch/install --no-daemon
|
||||
/tmp/nix-$GCR_NIX_VERSION-\$nix_arch/install --no-daemon
|
||||
rm -rf /tmp/nix*
|
||||
;;
|
||||
esac
|
||||
curl -fsSL "https://dl.gitea.com/gitea-runner/$GCR_ACT_RUNNER_VERSION/gitea-runner-$GCR_ACT_RUNNER_VERSION-linux-amd64" -o /usr/local/bin/gitea-runner
|
||||
printf '%s /usr/local/bin/gitea-runner\n' "$GCR_ACT_RUNNER_SHA256" | sha256sum -c -
|
||||
case "\$(uname -m)" in
|
||||
x86_64) runner_arch=amd64 ;;
|
||||
aarch64|arm64) runner_arch=arm64 ;;
|
||||
*) echo "unsupported arch for runner bootstrap: \$(uname -m)" >&2; exit 1 ;;
|
||||
esac
|
||||
curl -fsSL "https://dl.gitea.com/gitea-runner/$GCR_ACT_RUNNER_VERSION/gitea-runner-$GCR_ACT_RUNNER_VERSION-linux-\$runner_arch" -o /usr/local/bin/gitea-runner
|
||||
if [ "\$runner_arch" = amd64 ]; then
|
||||
printf '%s /usr/local/bin/gitea-runner\n' "$GCR_ACT_RUNNER_SHA256" | sha256sum -c -
|
||||
fi
|
||||
chmod 0755 /usr/local/bin/gitea-runner
|
||||
INSEOF
|
||||
chmod 0700 /usr/local/sbin/gcr-install
|
||||
|
||||
Reference in New Issue
Block a user