e3a9b019c0
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
- Build UI dist and push the UI image before the API image, and tag latest on both only after both versioned tags exist. - Label both images org.opencontainers.image.source so ghcr links the packages to the repo. - Pin nginx:alpine by digest in scripts/ui-image.sh and ui/Dockerfile.ui. - Release trigger narrowed to v[0-9]* tags.
20 lines
836 B
Bash
Executable File
20 lines
836 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>
|
|
set -euo pipefail
|
|
|
|
# Keep in sync with the FROM in ui/Dockerfile.ui.
|
|
base=nginx:alpine@sha256:fb4658584bd9a916ffb6f6e365f97c25cfdb2923801f551ea08356e695f14ff7
|
|
base_path=${BASE_PATH:-/ui}
|
|
source_url=https://github.com/IUCLabs/artifactapi
|
|
image=$1
|
|
|
|
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 mutate --platform linux/amd64 "$base" --append "$root.tar" \
|
|
--label "org.opencontainers.image.source=$source_url" -t "$image"
|