a33e07785e
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci / pre-commit (pull_request) Has been cancelled
ci / lint (pull_request) Has been cancelled
ci / test (pull_request) Has been cancelled
ci / build (pull_request) Has been cancelled
ci / ui (pull_request) Has been cancelled
20 lines
664 B
Bash
Executable File
20 lines
664 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Daemonless ui/Dockerfile.ui: append the built ui/dist and rendered nginx conf
|
|
# onto the nginx base. Usage: scripts/ui-image.sh <repo:tag> [extra-tag...]
|
|
set -euo pipefail
|
|
|
|
base_path=${BASE_PATH:-/ui}
|
|
image=$1
|
|
shift
|
|
|
|
root=$(mktemp -d)
|
|
mkdir -p "$root/usr/share/nginx/html" "$root/etc/nginx/conf.d"
|
|
cp -r ui/dist/. "$root/usr/share/nginx/html/"
|
|
sed "s|\${BASE_PATH}|${base_path}|g" ui/nginx.conf >"$root/etc/nginx/conf.d/default.conf"
|
|
tar -C "$root" --owner=0 --group=0 --numeric-owner -cf "$root.tar" usr etc
|
|
|
|
crane append --platform linux/amd64 -b nginx:alpine -f "$root.tar" -t "$image"
|
|
for tag in "$@"; do
|
|
crane tag "$image" "$tag"
|
|
done
|