Compare commits
2
Commits
1c6735cde8
...
70d7a4f606
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70d7a4f606 | ||
|
|
f4b534aa09 |
+10
-5
@@ -150,14 +150,19 @@ prints sizes and SHA-256 sums for the release notes.
|
|||||||
Push the desktop builds and their update metadata to the frontend's feed:
|
Push the desktop builds and their update metadata to the frontend's feed:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./push_desktop.sh # Linux packages (deb + pacman)
|
./push_desktop.sh # build Linux packages + copy the feed to jakerasp
|
||||||
./push_desktop.sh --win # also cross-build the NSIS installer (wine)
|
./push_desktop.sh --win # also cross-build the NSIS installer (wine)
|
||||||
|
./push_desktop.sh --local # publish locally only, skip the remote copy
|
||||||
|
./push_desktop.sh --host other:/path/to/J621
|
||||||
```
|
```
|
||||||
|
|
||||||
Artifacts land in `deploy/data/desktop/`, which the frontend nginx mounts
|
The remote copy defaults to `jakerasp:/home/jake/servers/J621`, or
|
||||||
read-only and serves at `/desktop/`. The desktop app's "Check for updates…"
|
`$J621_DESKTOP_FEED_HOST` when set. Artifacts land in `deploy/data/desktop/`,
|
||||||
menu item reads `latest-linux.yml` / `latest.yml` from there (see
|
which the frontend nginx mounts read-only and serves at `/desktop/`. The
|
||||||
`desktop/README.md`). Backend-only composes have no frontend, so no feed.
|
remote copy uses rsync when both ends have it, tar over ssh when the server
|
||||||
|
does not. The desktop app's "Check for updates…" menu item reads
|
||||||
|
`latest-linux.yml` / `latest.yml` from there (see `desktop/README.md`).
|
||||||
|
Backend-only composes have no frontend, so no feed.
|
||||||
|
|
||||||
## Scheduled jobs
|
## Scheduled jobs
|
||||||
|
|
||||||
|
|||||||
+56
-8
@@ -1,28 +1,46 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Build the J621 desktop packages and publish them to the frontend's update
|
# Build the J621 desktop packages and publish them to the update feed.
|
||||||
# feed (deploy/data/desktop, mounted read-only into the frontend nginx and
|
|
||||||
# served at /desktop/). electron-updater reads latest-linux.yml / latest.yml
|
|
||||||
# from there; the app's feed URL comes from desktop/electron-builder.yml.
|
|
||||||
#
|
#
|
||||||
# Usage: ./push_desktop.sh [--win] [--no-build]
|
# Locally the feed is deploy/data/desktop, which the frontend nginx mounts
|
||||||
|
# read-only and serves at /desktop/. With --host the same directory is also
|
||||||
|
# copied to a remote deploy checkout (rsync, or tar over ssh when the server
|
||||||
|
# has no rsync). electron-updater reads latest-linux.yml / latest.yml from
|
||||||
|
# there; the feed URL comes from desktop/electron-builder.yml.
|
||||||
|
#
|
||||||
|
# Usage: ./push_desktop.sh [--win] [--no-build] [--local] [--host user@server:/path]
|
||||||
# --win also cross-build the Windows NSIS installer (needs wine)
|
# --win also cross-build the Windows NSIS installer (needs wine)
|
||||||
# --no-build publish what is already in desktop/release/
|
# --no-build publish what is already in desktop/release/
|
||||||
|
# --local only publish locally, skip the remote copy
|
||||||
|
# --host override the remote deploy checkout
|
||||||
|
#
|
||||||
|
# The remote copy defaults to $J621_DESKTOP_FEED_HOST, or
|
||||||
|
# jakerasp:/home/jake/servers/J621 when that is not set.
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd "$(dirname "$0")/.."
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
|
DEFAULT_REMOTE="jakerasp:/home/jake/servers/J621"
|
||||||
BUILD=1
|
BUILD=1
|
||||||
WIN=0
|
WIN=0
|
||||||
for arg in "$@"; do
|
REMOTE="${J621_DESKTOP_FEED_HOST:-$DEFAULT_REMOTE}"
|
||||||
case "$arg" in
|
while [ $# -gt 0 ]; do
|
||||||
|
case "$1" in
|
||||||
--win) WIN=1 ;;
|
--win) WIN=1 ;;
|
||||||
--no-build) BUILD=0 ;;
|
--no-build) BUILD=0 ;;
|
||||||
|
--local) REMOTE="" ;;
|
||||||
|
--host) REMOTE="${2:?--host needs user@server:/path}"; shift ;;
|
||||||
*)
|
*)
|
||||||
echo "usage: $0 [--win] [--no-build]" >&2
|
echo "usage: $0 [--win] [--no-build] [--local] [--host user@server:/path]" >&2
|
||||||
exit 2
|
exit 2
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ -n "$REMOTE" ] && [ "$REMOTE" = "${REMOTE#*:}" ]; then
|
||||||
|
echo "--host needs user@server:/path (got '$REMOTE')" >&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$BUILD" = 1 ]; then
|
if [ "$BUILD" = 1 ]; then
|
||||||
echo "==> Building Linux packages (deb + pacman) ..."
|
echo "==> Building Linux packages (deb + pacman) ..."
|
||||||
npm --prefix desktop run dist:linux
|
npm --prefix desktop run dist:linux
|
||||||
@@ -57,6 +75,36 @@ fi
|
|||||||
|
|
||||||
echo "==> Published to $FEED:"
|
echo "==> Published to $FEED:"
|
||||||
ls -1sh "$FEED" | sed 's/^/ /'
|
ls -1sh "$FEED" | sed 's/^/ /'
|
||||||
|
|
||||||
|
if [ -n "$REMOTE" ]; then
|
||||||
|
REMOTE_TARGET="${REMOTE%%:*}"
|
||||||
|
REMOTE_ROOT="${REMOTE#*:}"
|
||||||
|
REMOTE_FEED="${REMOTE_ROOT%/}/deploy/data/desktop"
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "==> Copying the feed to $REMOTE_TARGET:$REMOTE_FEED ..."
|
||||||
|
transferred=0
|
||||||
|
if command -v rsync >/dev/null 2>&1; then
|
||||||
|
if rsync -a --info=progress2 "$FEED"/ "$REMOTE_TARGET:$REMOTE_FEED/"; then
|
||||||
|
transferred=1
|
||||||
|
else
|
||||||
|
echo "==> rsync did not work (missing on the server?); trying tar over ssh ..."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ "$transferred" -eq 0 ]; then
|
||||||
|
if ! ssh "$REMOTE_TARGET" "mkdir -p '$REMOTE_FEED'"; then
|
||||||
|
echo "ssh to $REMOTE_TARGET failed; nothing was copied." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if ! tar -C "$FEED" -cf - . |
|
||||||
|
ssh "$REMOTE_TARGET" "tar -C '$REMOTE_FEED' -xf -"; then
|
||||||
|
echo "Copy to $REMOTE_TARGET:$REMOTE_FEED failed." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo "==> Feed live at $REMOTE_TARGET:$REMOTE_FEED (no restart needed)."
|
||||||
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Served read-only by the frontend nginx at /desktop/ (no restart needed):"
|
echo "Served read-only by the frontend nginx at /desktop/ (no restart needed):"
|
||||||
echo " https://<frontend-host>/desktop/latest-linux.yml"
|
echo " https://<frontend-host>/desktop/latest-linux.yml"
|
||||||
|
|||||||
Reference in New Issue
Block a user