File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed
Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # tasks/docs-package.sh
3+ # Package generated documentation for release
4+
5+ set -e
6+
7+ VERSION=${1:- " dev" }
8+ OUTPUT_DIR=" release"
9+ DOCS_DIR=" docs/api"
10+
11+ echo " Packaging documentation for version: ${VERSION} "
12+
13+ # Validate documentation exists
14+ if [ ! -f " ${DOCS_DIR} /html/index.html" ]; then
15+ echo " Error: ${DOCS_DIR} /html/index.html not found"
16+ echo " Run 'mise run docs:generate' first to generate documentation"
17+ exit 1
18+ fi
19+
20+ # Validate documentation directory has content
21+ if [ ! -d " ${DOCS_DIR} /html" ] || [ -z " $( ls -A ${DOCS_DIR} /html) " ]; then
22+ echo " Error: ${DOCS_DIR} /html is empty or does not exist"
23+ exit 1
24+ fi
25+
26+ # Create output directory
27+ mkdir -p " ${OUTPUT_DIR} "
28+
29+ # Create archives
30+ echo " Creating archives..."
31+ cd " ${DOCS_DIR} "
32+
33+ # Create ZIP archive
34+ zip -r -q " ../../${OUTPUT_DIR} /eql-docs-${VERSION} .zip" html/
35+ echo " Created ${OUTPUT_DIR} /eql-docs-${VERSION} .zip"
36+
37+ # Create tarball
38+ tar czf " ../../${OUTPUT_DIR} /eql-docs-${VERSION} .tar.gz" html/
39+ echo " Created ${OUTPUT_DIR} /eql-docs-${VERSION} .tar.gz"
40+
41+ cd ../..
42+
43+ # Verify archives created
44+ if [ -f " ${OUTPUT_DIR} /eql-docs-${VERSION} .zip" ] && [ -f " ${OUTPUT_DIR} /eql-docs-${VERSION} .tar.gz" ]; then
45+ echo " "
46+ echo " Documentation packaged successfully:"
47+ ls -lh " ${OUTPUT_DIR} /eql-docs-${VERSION} " .*
48+ exit 0
49+ else
50+ echo " Error: Failed to create archives"
51+ exit 1
52+ fi
You can’t perform that action at this time.
0 commit comments