From 9ab82f7f6ddabd8c91566ca9cf1886bf5ea472ca Mon Sep 17 00:00:00 2001 From: Lucas Kent Date: Tue, 12 Dec 2023 09:44:27 +1100 Subject: [PATCH] Fix shotover release process (#1389) --- shotover-proxy/build/build_release.sh | 21 +++++---------------- shotover-proxy/build/build_static.sh | 15 --------------- shotover-proxy/build/static/Dockerfile | 4 ---- 3 files changed, 5 insertions(+), 35 deletions(-) delete mode 100755 shotover-proxy/build/build_static.sh delete mode 100644 shotover-proxy/build/static/Dockerfile diff --git a/shotover-proxy/build/build_release.sh b/shotover-proxy/build/build_release.sh index d8c483f51..cc5164d3e 100755 --- a/shotover-proxy/build/build_release.sh +++ b/shotover-proxy/build/build_release.sh @@ -4,28 +4,17 @@ set -e SCRIPT_DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -cd $SCRIPT_DIR/../.. +cd $SCRIPT_DIR -cargo test --release cargo build --release -# Make glibc version mkdir -p shotover -cp target/release/shotover-proxy shotover -cp -r shotover-proxy/config shotover +cp ../../target/release/shotover-proxy shotover +cp -r ../config shotover # extract the crate version from Cargo.toml CRATE_VERSION="$(cargo metadata --format-version 1 --offline --no-deps | jq -c -M -r '.packages[] | select(.name == "shotover-proxy") | .version')" -tar -cvzf shotover-proxy-linux_amd64-${CRATE_VERSION}.tar.gz shotover +tar -cvzf out.tar.gz shotover +mv out.tar.gz shotover-proxy-linux_amd64-${CRATE_VERSION}.tar.gz rm -rf shotover - - -### Building musl with rust-musl-builder only works on older rust toolchain versions so this is commented out until we can reenable it. -# Make musl version -#$SCRIPT_DIR/build_static.sh -# mkdir -p shotover-proxy -# cp target/x86_64-unknown-linux-musl/release/shotover-proxy shotover-proxy -# cp -r config shotover-proxy -# tar -cvzf shotover-proxy-static_linux_amd64-"$(cargo metadata --format-version 1 --offline --no-deps | jq -c -M -r '.packages[0].version')".tar.gz shotover-proxy -# rm -rf shotover-proxy diff --git a/shotover-proxy/build/build_static.sh b/shotover-proxy/build/build_static.sh deleted file mode 100755 index 49d82bc41..000000000 --- a/shotover-proxy/build/build_static.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -set -e - -SCRIPT_DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" - -echo "$SCRIPT_DIR" - -docker run --rm -it -v "$(pwd)":/home/rust/src -v "$(realpath ~/.cargo/git)":/home/rust/.cargo/git -v "$(realpath ~/.cargo/registry/)":/home/rust/.cargo/registry ekidd/rust-musl-builder:nightly-2020-08-15 bash -c "sudo chown -R rust:rust .; cargo build --release" - -cp "$SCRIPT_DIR"/../target/x86_64-unknown-linux-musl/release/shotover-proxy "$SCRIPT_DIR"/static - -docker build -f "$SCRIPT_DIR"/static/Dockerfile -t shotover/shotover-proxy-dev "$SCRIPT_DIR"/static - -rm "$SCRIPT_DIR"/static/shotover-proxy \ No newline at end of file diff --git a/shotover-proxy/build/static/Dockerfile b/shotover-proxy/build/static/Dockerfile deleted file mode 100644 index e77e2efcf..000000000 --- a/shotover-proxy/build/static/Dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM alpine:latest -RUN apk --no-cache add ca-certificates -COPY shotover-proxy /usr/local/bin/ -CMD /usr/local/bin/shotover-proxy \ No newline at end of file