From b7b50d110406d075e4663d5fd1a900d775c7229d Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Thu, 1 Sep 2022 16:39:34 -0400 Subject: [PATCH] Update docker scripts for testing --- backend/build-docker.sh | 14 ++++++++++++-- backend/build.sh | 6 +++--- backend/create_docker_img.sh | 4 ++++ backend/run_docker_img.sh | 7 +++++++ 4 files changed, 26 insertions(+), 5 deletions(-) mode change 100644 => 100755 backend/build-docker.sh create mode 100755 backend/create_docker_img.sh create mode 100755 backend/run_docker_img.sh diff --git a/backend/build-docker.sh b/backend/build-docker.sh old mode 100644 new mode 100755 index 1151d05..6243f9a --- a/backend/build-docker.sh +++ b/backend/build-docker.sh @@ -1,5 +1,15 @@ #!/bin/bash -$HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo build --release +echo "--- Rust version info ---" +rustup --version +rustc --version +cargo --version + +echo "--- Building plugin backend ---" +cargo build --release mkdir -p out -cp target/release/fantastic-rs out/backend \ No newline at end of file +cp target/release/fantastic-rs out/backend + +echo " --- Cleaning up ---" +# remove root-owned target folder +cargo clean diff --git a/backend/build.sh b/backend/build.sh index c939bde..7883d7e 100755 --- a/backend/build.sh +++ b/backend/build.sh @@ -1,5 +1,5 @@ #!/bin/bash -cross build --release -mkdir out -cp ./target/release/fantastic-rs out/backend +cargo build --target x86_64-unknown-linux-musl --release +mkdir -p ../bin +cp ./target/x86_64-unknown-linux-musl/release/fantastic-rs ../bin/backend diff --git a/backend/create_docker_img.sh b/backend/create_docker_img.sh new file mode 100755 index 0000000..a996f24 --- /dev/null +++ b/backend/create_docker_img.sh @@ -0,0 +1,4 @@ +#!/bin/bash +# build docker container locally (for testing) + +docker build -t fantastic_backend . diff --git a/backend/run_docker_img.sh b/backend/run_docker_img.sh new file mode 100755 index 0000000..bceb128 --- /dev/null +++ b/backend/run_docker_img.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# run docker container locally (for testing) +# assumes you're running in the backend/ dir of the project + +docker run -i --entrypoint /backend/entrypoint.sh -v $PWD:/backend fantastic_backend +mkdir -p ../bin +cp ./out/backend ../bin