Skip to content

Commit

Permalink
Move scripts to makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
RMcTn committed Sep 18, 2023
1 parent 8c04b1d commit 5d36dd6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
USER = root

build-for-server:
cargo zigbuild --target x86_64-unknown-linux-gnu --release

deploy-to-prod:
@if [ -z ${WHAT_BIN_HOST} ]; then\
echo "WHAT_BIN_HOST must be set" && exit 1;\
fi
ssh ${USER}@${WHAT_BIN_HOST} "mkdir -p /root/what-bin-is-it/archive"
scp -r ./target/x86_64-unknown-linux-gnu/release/server ${USER}@${WHAT_BIN_HOST}:/root/what-bin-is-it/server-new
ssh ${USER}@${WHAT_BIN_HOST} "mv /root/what-bin-is-it/server /root/what-bin-is-it/archive/server_$(date +"%Y%m%d%H%M%S")"
ssh ${USER}@${WHAT_BIN_HOST} "mv /root/what-bin-is-it/server-new /root/what-bin-is-it/server"
ssh ${USER}@${WHAT_BIN_HOST} "systemctl restart whatbin"
2 changes: 0 additions & 2 deletions build-for-x64-linux.sh

This file was deleted.

12 changes: 0 additions & 12 deletions deploy_binary_to_host.sh

This file was deleted.

0 comments on commit 5d36dd6

Please sign in to comment.