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