User:Legoktm/update-rust-web-tool
Appearance
#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
# (C) Copyright 2023 Kunal Mehta <legoktm@debian.org>
cd ~/www/rust
PREV=$(git log -n1 --format="%h")
git pull
HEAD=$(git log -n1 --format="%h")
if [[ $PREV != $HEAD ]]; then
time toolforge jobs run build --command "bash -c 'source ~/.profile && cd ~/www/rust && cargo build --release'" --image python3.11 --wait --mem 2G --cpu 1
webservice restart
dologmsg "Updated from $PREV to $HEAD"
else
echo "No updates."
fi