build scripts

This commit is contained in:
ntr 2019-07-16 18:02:28 +10:00
parent 5ad0938a13
commit 3573aeb405
4 changed files with 29 additions and 9 deletions

View File

@ -7,8 +7,5 @@ MNML_PATH=$(realpath "$DIR/../")
VERSION=$(<"$MNML_PATH/VERSION")
make server
cp -R "$MNML_PATH/server/target/release" "/usr/local/mnml/build/server/$VERSION"
make client
cp -R "$MNML_PATH/client/dist" "/usr/local/mnml/build/client/$VERSION"

View File

@ -5,8 +5,24 @@ DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
MNML_PATH=$(realpath "$DIR/../")
VERSION=$(<"$MNML_PATH/VERSION")
echo "syncing /usr/local/mnml/build/server/$VERSION"
rsync -a --delete --delete-excluded "/usr/local/mnml/build/server/$VERSION" mnml:"/usr/local/mnml/build/server/"
SERVER_BIN_DIR="/usr/local/mnml/bin"
CLIENT_DIST_DIR="/var/lib/mnml/client"
CLIENT_PUBLIC_DIR="/var/lib/mnml/public/current"
echo "syncing /usr/local/mnml/build/client/$VERSION"
rsync -a --delete --delete-excluded "/usr/local/mnml/build/client/$VERSION" mnml:"/usr/local/mnml/build/client/"
# server updates
echo "syncing server $VERSION "
rsync -a --delete --delete-excluded "$MNML_PATH/server/target/release/mnml" mnml:"$SERVER_BIN_DIR/$VERSION"
ssh -q mnml ln -nfs "$SERVER_BIN_DIR/$VERSION" "$SERVER_BIN_DIR/mnml"
ssh -q mnml ls -lah "$SERVER_BIN_DIR"
# client updates
echo "syncing client $VERSION"
rsync -a --delete --delete-excluded "$MNML_PATH/client/dist" mnml:"$CLIENT_DIST_DIR/$VERSION"
ssh -q mnml ln -nfs "$CLIENT_DIST_DIR/$VERSION" "$CLIENT_PUBLIC_DIR"
ssh -q mnml ls -lah "/var/lib/mnml/public"
echo "restarting mnml service"
ssh -q -t mnml sudo service mnml restart && sleep 1 && systemctl --no-pager status mnml
echo "restarting nginx service"
ssh -q -t mnml sudo service nginx restart && sleep 1 && systemctl --no-pager status nginx

View File

@ -8,7 +8,6 @@ ExecStart=/usr/local/mnml/bin/mnml
KillMode=process
Restart=on-failure
RestartPreventExitStatus=255
Type=notify
[Install]
WantedBy=multi-user.target

View File

@ -3,6 +3,13 @@ name = "mnml"
version = "0.1.0"
authors = ["ntr <ntr@smokestack.io>"]
# makes sure to include openssl links in runtime path
# [profile.release]
# rpath = true
# [profile.dev]
# rpath = true
[dependencies]
rand = "0.6"
uuid = { version = "0.5", features = ["serde", "v4"] }
@ -37,4 +44,5 @@ crossbeam-channel = "0.3"
stripe-rust = { version = "0.10.4", features = ["webhooks"] }
[patch.crates-io]
# stripe-rust = { git = "https://github.com/margh/stripe-rs.git" }
# stripe-rust = { git = "https://github.com/margh/stripe-rs.git" }