website-and-documentation/Taskfile.yml

226 lines
6 KiB
YAML
Raw Permalink Normal View History

version: '3'
vars:
HUGO_CMD: hugo
NPM_CMD: npm
tasks:
default:
desc: Show available tasks
cmds:
- task --list
# Build tasks
build:
desc: Build Hugo site
deps:
- deps:ensure-npm
- build:generate-info
cmds:
- "{{.HUGO_CMD}} --gc --minify"
build:dev:
desc: Build Hugo site for development
deps:
- deps:ensure-npm
- build:generate-info
cmds:
- "{{.HUGO_CMD}}"
build:generate-info:
desc: Generate build information (git commit, version, etc.)
sources:
- .git/HEAD
- .git/refs/**/*
generates:
- data/build_info.json
cmds:
- ./scripts/generate-build-info.sh
serve:
desc: Start Hugo dev server
deps:
- deps:ensure-npm
- build:generate-info
cmds:
- "{{.HUGO_CMD}} server"
clean:
desc: Clean build artifacts
cmds:
- rm -rf public resources/_gen .hugo_build.lock
# Test tasks
test:
desc: Run all tests
deps:
- test:build
- test:markdown
- test:html
- likec4:validate
test:hugo:
desc: Run Hugo-only tests (markdown, HTML, build)
deps:
- test:build
- test:markdown
- test:html
test:full:
desc: Run all tests including link check (may have errors in legacy content)
deps:
- test:build
- test:markdown
- test:html
- test:links
- likec4:validate
test:quick:
desc: Run quick tests (without link check)
deps:
- test:build
- test:markdown
- likec4:validate
test:build:
desc: Test Hugo build
deps:
- deps:ensure-npm
- build:generate-info
cmds:
- "{{.HUGO_CMD}} --gc --minify --logLevel info"
test:markdown:
desc: Lint markdown files
deps:
- deps:ensure-npm
cmds:
- "{{.NPM_CMD}} run test:markdown"
test:html:
desc: Validate HTML
deps:
- deps:ensure-npm
cmds:
- "{{.NPM_CMD}} run test:html"
test:links:
desc: Check links (skips legacy content)
cmds:
- |
# Move legacy dirs outside public temporarily
mkdir -p /tmp/htmltest-backup-$$
if [ -d "public/docs-old" ]; then mv public/docs-old /tmp/htmltest-backup-$$/; fi
if [ -d "public/blog" ]; then mv public/blog /tmp/htmltest-backup-$$/; fi
if [ -d "public/_print/docs-old" ]; then mv public/_print/docs-old /tmp/htmltest-backup-$$/docs-old-print; fi
# Run htmltest
htmltest || EXIT_CODE=$?
# Restore directories
if [ -d "/tmp/htmltest-backup-$$/docs-old" ]; then mv /tmp/htmltest-backup-$$/docs-old public/; fi
if [ -d "/tmp/htmltest-backup-$$/blog" ]; then mv /tmp/htmltest-backup-$$/blog public/; fi
if [ -d "/tmp/htmltest-backup-$$/docs-old-print" ]; then mv /tmp/htmltest-backup-$$/docs-old-print public/_print/docs-old; fi
rm -rf /tmp/htmltest-backup-$$
# Exit with the original exit code
exit ${EXIT_CODE:-0}
refactor(architecture): reorganize LikeC4 projects and consolidate webcomponents Renamed resources/likec4 to resources/edp-likec4 to better reflect that this directory contains the Enterprise Developer Platform architecture models, not documentation platform architecture. Extended element kinds in edp-likec4/models/spec.c4 to support documentation platform modeling: - Added person, tool, process, repository element kinds - These allow modeling of documentation workflows and processes Consolidated webcomponent generation: - Combined both architecture projects (edp-likec4 and doc-likec4) into a single webcomponent output at static/js/likec4-webcomponent.js - Updated Taskfile.yml to generate from edp-likec4 directory - Removed duplicate webcomponent script loading in head-end.html - Fixed CustomElementRegistry duplicate registration issue Embedded TeleNeoOffice corporate fonts: - Added font files to static/fonts/ and static/ root - Required for correct rendering of diagrams in webcomponent - Fonts are embedded in webcomponent but also served from Hugo static paths - Fixed 404 errors for font loading Updated architecture documentation: - Fixed markdown linting issues (trailing spaces, fence spacing) - Updated all references from resources/likec4 to resources/edp-likec4 - Enhanced setup.md with correct directory structure This refactoring enables: 1. Clear separation between EDP architecture and documentation platform models 2. Single consolidated webcomponent containing all architecture views 3. Proper font loading for corporate branding in diagrams 4. Foundation for future architecture documentation expansion Breaking changes: None (paths updated in documentation)
2025-11-07 11:50:17 +01:00
# LikeC4 tasks
likec4:generate:
desc: Generate LikeC4 webcomponent (includes all architecture projects)
cmds:
2025-11-12 00:33:03 +01:00
- npx likec4 codegen webcomponent --webcomponent-prefix likec4 --outfile static/js/likec4-webcomponent.js resources/edp-likec4 resources/doc-likec4
refactor(architecture): reorganize LikeC4 projects and consolidate webcomponents Renamed resources/likec4 to resources/edp-likec4 to better reflect that this directory contains the Enterprise Developer Platform architecture models, not documentation platform architecture. Extended element kinds in edp-likec4/models/spec.c4 to support documentation platform modeling: - Added person, tool, process, repository element kinds - These allow modeling of documentation workflows and processes Consolidated webcomponent generation: - Combined both architecture projects (edp-likec4 and doc-likec4) into a single webcomponent output at static/js/likec4-webcomponent.js - Updated Taskfile.yml to generate from edp-likec4 directory - Removed duplicate webcomponent script loading in head-end.html - Fixed CustomElementRegistry duplicate registration issue Embedded TeleNeoOffice corporate fonts: - Added font files to static/fonts/ and static/ root - Required for correct rendering of diagrams in webcomponent - Fonts are embedded in webcomponent but also served from Hugo static paths - Fixed 404 errors for font loading Updated architecture documentation: - Fixed markdown linting issues (trailing spaces, fence spacing) - Updated all references from resources/likec4 to resources/edp-likec4 - Enhanced setup.md with correct directory structure This refactoring enables: 1. Clear separation between EDP architecture and documentation platform models 2. Single consolidated webcomponent containing all architecture views 3. Proper font loading for corporate branding in diagrams 4. Foundation for future architecture documentation expansion Breaking changes: None (paths updated in documentation)
2025-11-07 11:50:17 +01:00
likec4:validate:
desc: Validate LikeC4 models
cmds:
- echo "Validating EDP architecture models..."
- npx likec4 validate --ignore-layout resources/edp-likec4
- echo "Validating Documentation platform models..."
- npx likec4 validate --ignore-layout resources/doc-likec4
- echo "✓ All LikeC4 models validated successfully"
likec4:validate:layout:
desc: Validate LikeC4 models including layout
cmds:
- echo "Validating EDP architecture models (including layout)..."
- npx likec4 validate resources/edp-likec4
- echo "Validating Documentation platform models (including layout)..."
- npx likec4 validate resources/doc-likec4
- echo "✓ All LikeC4 models and layouts validated successfully"
likec4:update:
desc: Update LikeC4 to latest version
cmds:
- npm update likec4 --prefix resources/edp-likec4
- npm update likec4 --prefix resources/doc-likec4
- echo "✓ LikeC4 updated in both projects"
# Development tasks
deps:ensure-npm:
desc: Ensure npm dependencies are installed
sources:
- package.json
- package-lock.json
generates:
- node_modules/.package-lock.json
cmds:
- "{{.NPM_CMD}} ci"
status:
- test -d node_modules
deps:install:
desc: Install all dependencies
cmds:
- "{{.NPM_CMD}} ci"
- "{{.HUGO_CMD}} mod get -u"
- "{{.HUGO_CMD}} mod tidy"
deps:update:
desc: Update dependencies
cmds:
- devbox update
- "{{.NPM_CMD}} update"
- "{{.HUGO_CMD}} mod get -u"
# CI/CD
ci:
desc: Run CI pipeline locally
deps:
- test
build:oci-image:
desc: Build OCI/Docker image with versions from .env.versions
cmds:
- |
set -a
source .env.versions
set +a
echo "Building OCI image with versions:"
echo " NODE_VERSION=${NODE_VERSION}"
echo " GO_VERSION=${GO_VERSION}"
echo " HUGO_VERSION=${HUGO_VERSION}"
docker build --network=host \
--build-arg NODE_VERSION=${NODE_VERSION} \
--build-arg GO_VERSION=${GO_VERSION} \
--build-arg HUGO_VERSION=${HUGO_VERSION} \
-t ipceicis-developerframework:latest \
-t ipceicis-developerframework:$(git rev-parse --short HEAD) \
.
test:oci-image:
desc: Test the built OCI image
deps:
- build:oci-image
cmds:
- |
echo "Starting container on port 8080..."
docker run -d -p 8080:80 --name hugo-test ipceicis-developerframework:latest
sleep 2
echo "Testing endpoint..."
curl -f http://localhost:8080 > /dev/null && echo "✓ Container is running and responding" || echo "✗ Container test failed"
echo "Cleaning up..."
docker stop hugo-test
docker rm hugo-test