Container (nginx:alpine), k8s manifests, ArgoCD app, Caddy route, and deploy workflow. Content is built and released from the separate cv repo (forge.ops.eblu.me/eblume/cv). Also removes unnecessary sh -c wrapper around tar in build_docs Dagger function. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
31 lines
776 B
Bash
31 lines
776 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
HTML_DIR="/usr/share/nginx/html"
|
|
|
|
# Check for required environment variable
|
|
if [ -z "$CV_RELEASE_URL" ]; then
|
|
echo "Error: CV_RELEASE_URL environment variable is required"
|
|
echo "Set it to the URL of the CV content tarball to serve"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Downloading CV content from: $CV_RELEASE_URL"
|
|
|
|
# Download the tarball
|
|
if ! curl -fsSL "$CV_RELEASE_URL" -o /tmp/cv.tar.gz; then
|
|
echo "Error: Failed to download CV content from $CV_RELEASE_URL"
|
|
exit 1
|
|
fi
|
|
|
|
# Clear existing content and extract
|
|
rm -rf "${HTML_DIR:?}"/*
|
|
echo "Extracting CV content to $HTML_DIR"
|
|
tar -xzf /tmp/cv.tar.gz -C "$HTML_DIR"
|
|
rm /tmp/cv.tar.gz
|
|
|
|
echo "CV content extracted successfully"
|
|
echo "Starting nginx..."
|
|
|
|
# Start nginx in foreground
|
|
exec nginx -g "daemon off;"
|