Skip to content

Commit 1e516af

Browse files
committed
Support other platforms than Linux
1 parent ede844c commit 1e516af

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

local/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
1616
git \
1717
gnupg \
1818
jq \
19+
libssl-dev \
20+
openssl \
21+
pkg-config \
1922
python3 \
2023
socat
2124

2225
# Install rustup while removing the pre-installed stable toolchain.
23-
RUN curl https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init >/tmp/rustup-init && \
24-
chmod +x /tmp/rustup-init && \
25-
/tmp/rustup-init -y --no-modify-path --profile minimal --default-toolchain stable && \
26+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
27+
sh -s -- -y --no-modify-path --profile minimal --default-toolchain stable && \
2628
/root/.cargo/bin/rustup toolchain remove stable
2729
ENV PATH=/root/.cargo/bin:$PATH
2830

local/release.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ for file in "${DOWNLOAD_STANDALONE[@]}"; do
101101
download "${file}"
102102
done
103103

104+
# Build the promote-release binary if it hasn't been pre-built
105+
if [[ ! -f "/src/target/release/promote-release" ]]; then
106+
echo "==> building promote-release"
107+
cd /src
108+
cargo build --release
109+
cd ..
110+
fi
111+
104112
echo "==> configuring the environment"
105113
# Point to the right GnuPG environment
106114
export GNUPGHOME=/persistent/gpg-home

run.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ if [[ "${container_status}" != "running" ]]; then
4343
exit 1
4444
fi
4545

46-
# Ensure the release build is done
47-
cargo build --release
46+
# Pre-built the binary if the host and Docker environments match
47+
if [[ "$(uname)" == "Linux" ]]; then
48+
cargo build --release
49+
fi
4850

4951
# Run the command inside the docker environment.
5052
docker-compose exec -T local "/src/local/${command}.sh" "${channel}" "${override_commit}"

0 commit comments

Comments
 (0)