Skip to content

Commit

Permalink
[BUGFIX #4] Deploy rust without docker
Browse files Browse the repository at this point in the history
  • Loading branch information
nrs23 committed Nov 9, 2023
1 parent 8b35e4c commit 5c47b1a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 12 additions & 4 deletions deploy-rust.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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-api.sh

0 comments on commit 5c47b1a

Please sign in to comment.