Show build info in header
Deploy the CI-built wheel for the triggering SHA so the UI and\nbuild metadata stay in sync in production.
This commit is contained in:
+16
-6
@@ -16,10 +16,16 @@ PREFIX=${IMPORTARR_PREFIX:-/opt/importarr}
|
||||
REPO_DIR=${IMPORTARR_REPO_DIR:-$PREFIX/repo}
|
||||
SERVICE=${IMPORTARR_SERVICE:-importarr.service}
|
||||
VENV=${IMPORTARR_VENV:-$PREFIX/venv}
|
||||
if [ "$#" -ne 0 ]; then
|
||||
echo "Usage: $0" >&2
|
||||
if [ "$#" -gt 2 ]; then
|
||||
echo "Usage: $0 [wheel [revision]]" >&2
|
||||
exit 2
|
||||
fi
|
||||
WHEEL=${1:-}
|
||||
REVISION=${2:-}
|
||||
if [ -n "$WHEEL" ] && [ ! -f "$WHEEL" ]; then
|
||||
echo "Built wheel not found: $WHEEL" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LOCK_FILE=${IMPORTARR_UPGRADE_LOCK_FILE:-$PREFIX/repo-upgrade.lock}
|
||||
exec 9>"$LOCK_FILE"
|
||||
@@ -40,10 +46,14 @@ if [ -n "$(git status --porcelain)" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git fetch --prune origin main
|
||||
git checkout -B main origin/main
|
||||
test "$(git rev-parse HEAD)" = "$(git rev-parse origin/main)"
|
||||
"$VENV/bin/pip" install --upgrade --force-reinstall --no-cache-dir "$REPO_DIR"
|
||||
if [ -n "$REVISION" ]; then
|
||||
test "$(git rev-parse HEAD)" = "$(git rev-parse "$REVISION^{commit}")"
|
||||
else
|
||||
git fetch --prune origin main
|
||||
git checkout -B main origin/main
|
||||
test "$(git rev-parse HEAD)" = "$(git rev-parse origin/main)"
|
||||
fi
|
||||
"$VENV/bin/pip" install --upgrade --force-reinstall --no-cache-dir "${WHEEL:-$REPO_DIR}"
|
||||
if [ -f "$ENV_FILE" ]; then
|
||||
sed -i '/^[[:space:]]*IMPORTARR_UPDATE_COMMAND=/d' "$ENV_FILE"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user