diff --git a/README.md b/README.md index af21f17..b948f8f 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,7 @@ Similar advice is available from government sources on a subscription basis, mos # TODOs -- [✓] Build a decent docker template for the rust API [KN 4/11/23] -- [] Set up CI to deploy to digitalocean droplet using ssh and docker +See https://github.com/nseymoursmith/waterlogged-prototype/issues # User flow diff --git a/deploy-rust.sh b/deploy-rust.sh index 5df22fc..7d3e1eb 100644 --- a/deploy-rust.sh +++ b/deploy-rust.sh @@ -6,16 +6,24 @@ if [ $? != 0 ]; then exit 1 fi +./stop-api.sh + if ! [ -d "$HOME/waterlogged-prototype/dockerised-rust-api/" ]; then echo 'docker app directory does not exist!' exit 1 fi cd $HOME/waterlogged-prototype/dockerised-rust-api/ -pwd -ls -la -docker compose up --build -d +cargo build --release if [ $? != 0 ]; then - echo "docker compose failed, check the server logs!" + echo "cargo build failed, check the server logs!" exit 1 fi + +./target/release/api-example & + +PID=$! + +echo "kill $!" > stop-api.sh + +chmod +x stop-air.sh