diff --git a/.woodpecker/release.yaml b/.woodpecker/release.yaml index dfa791a3..0678a45b 100644 --- a/.woodpecker/release.yaml +++ b/.woodpecker/release.yaml @@ -23,7 +23,7 @@ steps: - name: check is static binary image: nixpkgs/nix:nixos-22.05 commands: - - nix-shell --attr ci --run "./script/not-dynamic.sh result-bin/bin/garage" + - nix-shell --attr ci --run "./script/not-dynamic.sh result/bin/garage" - name: integration tests image: nixpkgs/nix:nixos-22.05 diff --git a/Dockerfile b/Dockerfile index 62e51b32..2e301ee9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,5 +3,5 @@ FROM scratch ENV RUST_BACKTRACE=1 ENV RUST_LOG=garage=info -COPY result-bin/bin/garage / +COPY result/bin/garage / CMD [ "/garage", "server"] diff --git a/script/not-dynamic.sh b/script/not-dynamic.sh index b9a13070..2beb4e0b 100755 --- a/script/not-dynamic.sh +++ b/script/not-dynamic.sh @@ -7,7 +7,12 @@ if [ "$#" -ne 1 ]; then exit 2 fi -if file $1 | grep 'dynamically linked' 2>&1; then +if [ ! -x "$1" ]; then + echo "[fail] $1 does not exist or is not an executable" + exit 1 +fi + +if file "$1" | grep 'dynamically linked' 2>&1; then echo "[fail] $1 is dynamic" exit 1 fi diff --git a/shell.nix b/shell.nix index ab0bc71f..cfccfe94 100644 --- a/shell.nix +++ b/shell.nix @@ -39,7 +39,7 @@ in --endpoint-url https://garage.deuxfleurs.fr \ --region garage \ s3 cp \ - ./result-bin/bin/garage \ + ./result/bin/garage \ s3://garagehq.deuxfleurs.fr/_releases/''${CI_COMMIT_TAG:-$CI_COMMIT_SHA}/''${TARGET}/garage }