tailscale/release/dist/qnap/files/scripts/build-qpkg.sh
Sonia Appasamy 0cce456ee5 release/dist/qnap: use tmp file directory for qpkg building
This change allows for the release/dist/qnap package to be used
outside of the tailscale repo (notably, will be used from corp),
by using an embedded file system for build files which gets
temporarily written to a new folder during qnap build runs.

Without this change, when used from corp, the release/dist/qnap
folder will fail to be found within the corp repo, causing
various steps of the build to fail.

The file renames in this change are to combine the build files
into a /files folder, separated into /scripts and /Tailscale.

Updates tailscale/tailscale-qpkg#135

Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
2024-04-23 21:34:45 -04:00

20 lines
454 B
Bash
Executable File

#!/bin/bash
set -eu
# Clean up folders and files created during build.
function cleanup() {
rm -rf /Tailscale/$ARCH
rm -f /Tailscale/sed*
rm -f /Tailscale/qpkg.cfg
}
trap cleanup EXIT
mkdir -p /Tailscale/$ARCH
cp /tailscaled /Tailscale/$ARCH/tailscaled
cp /tailscale /Tailscale/$ARCH/tailscale
sed "s/\$QPKG_VER/$TSTAG-$QNAPTAG/g" /Tailscale/qpkg.cfg.in > /Tailscale/qpkg.cfg
qbuild --root /Tailscale --build-arch $ARCH --build-dir /out