2021-12-02 17:42:02 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# build needed Docker container
|
|
|
|
docker build . -t rust-deb:bullseye
|
|
|
|
|
|
|
|
# Go to innernet-src submodule
|
|
|
|
cd innernet-src || exit
|
|
|
|
|
|
|
|
INNERNET_VERSION="${INNERNET_VERSION:-1.5.1}"
|
|
|
|
|
|
|
|
# Checkout correct version
|
|
|
|
git checkout "v${INNERNET_VERSION}"
|
|
|
|
|
|
|
|
# Build binaries
|
|
|
|
echo "Building binaries"
|
|
|
|
docker run --rm -v $PWD:/innernet rust-deb:bullseye cargo deb -p client
|
|
|
|
docker run --rm -v $PWD:/innernet rust-deb:bullseye cargo deb -p server
|
|
|
|
|
|
|
|
# Copy binaries to Ansible roles
|
|
|
|
echo "Copying binaries"
|
2021-12-15 18:36:55 +01:00
|
|
|
mkdir -p ../roles/server/files && \
|
2021-12-02 17:42:02 +01:00
|
|
|
cp target/debian/innernet-server_"$INNERNET_VERSION"_amd64.deb ../roles/server/files/innernet-server.deb
|
|
|
|
|
2021-12-15 18:36:55 +01:00
|
|
|
mkdir -p ../roles/client/files && \
|
2021-12-02 17:42:02 +01:00
|
|
|
cp target/debian/innernet_"$INNERNET_VERSION"_amd64.deb ../roles/client/files/innernet.deb
|