chore: Add worktree deployment support (#2491)
This commit is contained in:
committed by
dermotduffy
parent
f21a46297a
commit
3f0d2ef14d
@@ -0,0 +1,3 @@
|
|||||||
|
# Worktrunk project configuration. See https://worktrunk.dev/config/.
|
||||||
|
# Install Node deps when a new worktree is created.
|
||||||
|
pre-start.yarn-install = "yarn install --immutable"
|
||||||
@@ -180,6 +180,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "rollup -c --watch",
|
"start": "rollup -c --watch",
|
||||||
|
"deployment-update": "./scripts/deployment-update-symlink.sh",
|
||||||
"build": "yarn run lint && yarn run rollup",
|
"build": "yarn run lint && yarn run rollup",
|
||||||
"docs": "docsify serve ./docs",
|
"docs": "docsify serve ./docs",
|
||||||
"docs-check-links": "docker run --init --rm -v \"$(pwd):/input\" -w /input lycheeverse/lychee --config lychee.toml \"./docs/\"",
|
"docs-check-links": "docker run --init --rm -v \"$(pwd):/input\" -w /input lycheeverse/lychee --config lychee.toml \"./docs/\"",
|
||||||
|
|||||||
Executable
+21
@@ -0,0 +1,21 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# `yarn deployment-update` — point the manual-test Home Assistant instance at
|
||||||
|
# this worktree.
|
||||||
|
#
|
||||||
|
# Repoints the `$ACC_LIVE_LINK` symlink (the dev static server's document root)
|
||||||
|
# at this worktree's `dist/`. HA loads the card from a fixed URL served off that
|
||||||
|
# static server, so switching worktrees is just this one symlink hop.
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
if [[ -z "${ACC_LIVE_LINK:-}" ]]; then
|
||||||
|
echo "ACC_LIVE_LINK is not set — point it at the symlink to update." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
TARGET="$PWD/dist"
|
||||||
|
mkdir -p "$(dirname "$ACC_LIVE_LINK")"
|
||||||
|
ln -sfn "$TARGET" "$ACC_LIVE_LINK"
|
||||||
|
|
||||||
|
echo "Advanced Camera Card → $TARGET"
|
||||||
|
[[ -d "$TARGET" ]] || echo "(no dist/ here yet — run \`yarn start\` to build it)"
|
||||||
Reference in New Issue
Block a user