Skip to content

Commit 49d7d0c

Browse files
Merge pull request #1 from DocOps/full-launch
feat: Full DocOps Lab website launch with docopslab-dev gem
2 parents 748176a + da9e703 commit 49d7d0c

File tree

301 files changed

+34878
-31
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

301 files changed

+34878
-31
lines changed

.config/actionlint.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# actionlint configuration for this project
2+
# References DocOps Lab base configuration
3+
4+
# Note: Shellcheck integration is disabled via -shellcheck= flag in rake task
5+
# Use dedicated shellcheck linter instead
6+
7+
# Project-specific ignores (add as needed):
8+
# paths:
9+
# .github/workflows/**/*.{yml,yaml}:
10+
# ignore:
11+
# - 'pattern to ignore'

.config/docopslab-dev.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
source:
2+
repo: DocOps/lab
3+
ref: v1
4+
root: gems/docopslab-dev/assets/config-packs
5+
docs:
6+
- source: docs/agent/AGENTS.md
7+
target: AGENTS.md
8+
synced: false
9+
- source: docs/agent/skills/*.md
10+
target: .agent/docs/skills
11+
synced: true
12+
- source: docs/agent/topics/*.md
13+
target: .agent/docs/topics
14+
synced: true
15+
- source: docs/agent/roles/*.md
16+
target: .agent/docs/roles
17+
synced: true
18+
- source: docs/agent/missions/*.md
19+
target: .agent/docs/missions
20+
synced: true
21+
tools:
22+
- tool: rubocop
23+
files:
24+
- source: rubocop/base.yml
25+
target: .config/.vendor/docopslab/rubocop.yml
26+
synced: true
27+
- source: rubocop/project.yml
28+
target: .config/rubocop.yml
29+
synced: false
30+
31+
- tool: vale
32+
files:
33+
- source: vale/base.ini
34+
target: .config/.vendor/docopslab/vale.ini
35+
synced: true
36+
- source: vale/project.ini
37+
target: .config/vale.local.ini
38+
synced: false
39+
paths:
40+
lint: ['.']
41+
skip:
42+
- _metablog/_asciidoc-snippets.adoc
43+
- _metablog/_asciidoc-crazy-table-snippet.adoc
44+
- _docs/partials/built/*
45+
- _projects/*
46+
exts: ['adoc']
47+
# git_tracked_only: false
48+
49+
- tool: htmlproofer
50+
files:
51+
- source: htmlproofer/base.yml
52+
target: .config/.vendor/docopslab/htmlproofer.yml
53+
synced: true
54+
- source: htmlproofer/project.yml
55+
target: .config/htmlproofer.local.yml
56+
synced: false
57+
paths:
58+
lint: _site
59+
60+
- tool: shellcheck
61+
files:
62+
- source: shellcheck/base.shellcheckrc
63+
target: .config/shellcheckrc
64+
synced: true
65+
66+
- tool: actionlint
67+
files:
68+
- source: actionlint/base.yml
69+
target: .config/.vendor/docopslab/actionlint.yml
70+
synced: true
71+
- source: actionlint/project.yml
72+
target: .config/actionlint.yml
73+
synced: false

.config/htmlproofer.local.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# DocOps Lab - Project-specific HTMLProofer Configuration
2+
# This file contains project-specific overrides for HTMLProofer settings.
3+
# It will be merged with the base organizational config at runtime.
4+
5+
# Project-specific URL ignores (will be merged with base ignores)
6+
# ignore_urls:
7+
# - /project-specific-url/
8+
9+
# Project-specific file ignores (will be merged with base ignores)
10+
# ignore_files:
11+
# - project-specific-dir/
12+
13+
# Override any base settings here:
14+
# check_external_hash: true
15+
# disable_external: true
16+
17+
# Add any project-specific settings below:
18+
check_directory: _site

.config/rubocop.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# DocOps Lab RuboCop Configuration
2+
3+
inherit_from: .vendor/docopslab/rubocop.yml
4+
5+
# Increase metrics limits for this codebase
6+
Metrics/ClassLength:
7+
Max: 300
8+
Exclude:
9+
- 'gems/docopslab-dev/lib/docopslab/dev/linters.rb' # Linters module is large by nature
10+
- 'gems/docopslab-dev/lib/docopslab/dev/tasks.rb' # Just lots of tasks
11+
12+
Metrics/ModuleLength:
13+
Max: 350
14+
15+
Metrics/MethodLength:
16+
Max: 100
17+
Exclude:
18+
- 'gems/docopslab-dev/lib/docopslab/dev/tasks.rb' # Task definitions are naturally long
19+
20+
Metrics/BlockLength:
21+
Max: 100
22+
23+
Metrics/ParameterLists:
24+
Max: 6

.config/shellcheckrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# ShellCheck configuration for DocOps Lab projects
2+
# This file is synced from docopslab-dev gem
3+
4+
# Disable some overly strict rules for our use cases
5+
disable=SC2034 # Variable appears unused (common in sourced scripts)
6+
disable=SC2086 # Double quote to prevent globbing (sometimes we want globbing)
7+
disable=SC2181 # Check exit code directly with e.g. 'if mycmd;', not indirectly with $?
8+
9+
# Set default shell to bash (most of our scripts are bash)
10+
shell=bash
11+
12+
# Enable additional optional checks
13+
enable=quote-safe-variables
14+
enable=require-variable-braces

.config/vale.local.ini

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# DocOps Lab Vale Configuration
2+
# Combined base and project configuration for consistent Vale linting
3+
4+
MinAlertLevel = warning
5+
StylesPath = .vendor/vale/styles
6+
7+
[asciidoctor]
8+
missing-attribute = drop
9+
safe = unsafe
10+
experimental = YES
11+
12+
[_metablog/*.adoc]
13+
DocOpsLab-AsciiDoc.ExplicitSectionIDs = NO
14+
15+
[_blog/*.adoc]
16+
DocOpsLab-AsciiDoc.ExplicitSectionIDs = NO
17+
18+
[_docs/agent/**/*.adoc]
19+
DocOpsLab-AsciiDoc.ExplicitSectionIDs = NO
20+
DocOpsLab-AsciiDoc.ExtraLineBeforeLevel1 = NO
21+
22+
[_docs/agent/skills/asciidoc.adoc]
23+
DocOpsLab-AsciiDoc.ProperDLs = NO
24+
DocOpsLab-AsciiDoc.OneSentencePerLine = NO
25+
26+
[_docs/templates/AGENTS.markdown]
27+
BasedOnStyles = DocOpsLab-Authoring

.github/workflows/build-docs.yml

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
name: Build and Deploy Documentation
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
ruby_version:
7+
description: "Ruby version for building docs"
8+
type: string
9+
default: "3.2"
10+
enable_cache:
11+
description: "Enable bundler and other caching"
12+
type: boolean
13+
default: true
14+
publish_pages:
15+
description: "Publish to GitHub Pages"
16+
type: boolean
17+
default: true
18+
build_command:
19+
description: "Custom build command (default: auto-detect)"
20+
type: string
21+
required: false
22+
source_dir:
23+
description: "Source directory for docs"
24+
type: string
25+
default: "."
26+
output_dir:
27+
description: "Output directory (relative to source_dir)"
28+
type: string
29+
default: "_site"
30+
secrets:
31+
GITHUB_TOKEN:
32+
description: "GitHub token for Pages deployment"
33+
required: false
34+
35+
# Set permissions for GitHub Pages deployment
36+
permissions:
37+
contents: read
38+
pages: write
39+
id-token: write
40+
41+
# Allow only one concurrent deployment
42+
concurrency:
43+
group: "pages"
44+
cancel-in-progress: false
45+
46+
jobs:
47+
build:
48+
runs-on: ubuntu-latest
49+
timeout-minutes: 30
50+
steps:
51+
- name: Checkout code
52+
uses: actions/checkout@v4
53+
54+
- name: Set up Ruby
55+
uses: ruby/setup-ruby@v1
56+
with:
57+
ruby-version: ${{ inputs.ruby_version }}
58+
bundler-cache: ${{ inputs.enable_cache }}
59+
60+
- name: Setup Pages
61+
id: pages
62+
if: inputs.publish_pages
63+
uses: actions/configure-pages@v4
64+
65+
- name: Sync DocOps Lab configs
66+
run: |
67+
if bundle exec rake -T | grep -q "labdev:sync:configs"; then
68+
bundle exec rake labdev:sync:configs
69+
fi
70+
71+
- name: Auto-detect and build documentation
72+
run: | # this block seems overwrought; let's review and trim
73+
if [ -n "${{ inputs.build_command }}" ]; then
74+
echo "Using custom build command: ${{ inputs.build_command }}"
75+
cd ${{ inputs.source_dir }}
76+
${{ inputs.build_command }}
77+
elif [ -f "_config.yml" ]; then
78+
echo "Jekyll site detected - building with Jekyll"
79+
cd ${{ inputs.source_dir }}
80+
bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path || '' }}"
81+
elif [ -f "config.ru" ]; then
82+
echo "Rack application detected"
83+
cd ${{ inputs.source_dir }}
84+
# For Rack apps, we might need a custom build process
85+
if bundle exec rake -T | grep -q "build\|assets"; then
86+
bundle exec rake build || bundle exec rake assets:precompile || echo "No build task found"
87+
fi
88+
elif [ -f "Rakefile" ] && bundle exec rake -T | grep -q "docs\|build"; then
89+
echo "Rakefile with docs task detected"
90+
cd ${{ inputs.source_dir }}
91+
if bundle exec rake -T | grep -q "docs"; then
92+
bundle exec rake docs
93+
elif bundle exec rake -T | grep -q "build"; then
94+
bundle exec rake build
95+
fi
96+
elif find . -name "*.adoc" -o -name "*.md" | head -1 | grep -q .; then
97+
echo "AsciiDoc/Markdown files detected - building with AsciiDoctor"
98+
cd ${{ inputs.source_dir }}
99+
# Create a simple build for AsciiDoc files
100+
mkdir -p ${{ inputs.output_dir }}
101+
if command -v asciidoctor &> /dev/null; then
102+
find . -name "*.adoc" -exec asciidoctor {} -D ${{ inputs.output_dir }} \;
103+
fi
104+
if command -v pandoc &> /dev/null; then
105+
find . -name "*.md" -exec pandoc {} -o ${{ inputs.output_dir }}/{}.html \;
106+
fi
107+
else
108+
echo "No recognized documentation format - creating minimal index"
109+
cd ${{ inputs.source_dir }}
110+
mkdir -p ${{ inputs.output_dir }}
111+
echo "<html><body><h1>Documentation</h1><p>Built from $(pwd)</p></body></html>" > ${{ inputs.output_dir }}/index.html
112+
fi
113+
114+
- name: Validate build output
115+
run: |
116+
cd ${{ inputs.source_dir }}
117+
if [ ! -d "${{ inputs.output_dir }}" ]; then
118+
echo "❌ Output directory ${{ inputs.output_dir }} not found!"
119+
exit 1
120+
fi
121+
122+
if [ ! -f "${{ inputs.output_dir }}/index.html" ]; then
123+
echo "⚠️ No index.html found in ${{ inputs.output_dir }}"
124+
# Try to find any HTML file to use as index
125+
html_file=$(find ${{ inputs.output_dir }} -name "*.html" | head -1)
126+
if [ -n "$html_file" ]; then
127+
echo "Using $html_file as index.html"
128+
cp "$html_file" "${{ inputs.output_dir }}/index.html"
129+
else
130+
echo "Creating minimal index.html"
131+
echo "<html><body><h1>Documentation</h1></body></html>" > ${{ inputs.output_dir }}/index.html
132+
fi
133+
fi
134+
135+
echo "✅ Build output validated"
136+
echo "Files in ${{ inputs.output_dir }}:"
137+
ls -la ${{ inputs.output_dir }}
138+
139+
- name: Upload Pages artifact
140+
if: inputs.publish_pages
141+
uses: actions/upload-pages-artifact@v3
142+
with:
143+
path: ${{ inputs.source_dir }}/${{ inputs.output_dir }}
144+
145+
- name: Upload build artifact
146+
if: ${{ !inputs.publish_pages }}
147+
uses: actions/upload-artifact@v4
148+
with:
149+
name: documentation
150+
path: ${{ inputs.source_dir }}/${{ inputs.output_dir }}
151+
152+
deploy:
153+
environment:
154+
name: github-pages
155+
url: ${{ steps.deployment.outputs.page_url }}
156+
runs-on: ubuntu-latest
157+
needs: build
158+
if: inputs.publish_pages
159+
timeout-minutes: 10
160+
outputs:
161+
page_url: ${{ steps.deployment.outputs.page_url }}
162+
steps:
163+
- name: Deploy to GitHub Pages
164+
id: deployment
165+
uses: actions/deploy-pages@v4
166+
167+
summary:
168+
runs-on: ubuntu-latest
169+
needs: [build, deploy]
170+
if: always()
171+
timeout-minutes: 2
172+
steps:
173+
- name: Documentation Build Summary
174+
run: |
175+
echo "## Documentation Build Results" >> $GITHUB_STEP_SUMMARY
176+
echo "" >> $GITHUB_STEP_SUMMARY
177+
178+
# Build Results
179+
if [ "${{ needs.build.result }}" = "success" ]; then
180+
echo "✅ **Build**: Documentation built successfully" >> $GITHUB_STEP_SUMMARY
181+
else
182+
echo "❌ **Build**: Documentation build failed" >> $GITHUB_STEP_SUMMARY
183+
fi
184+
185+
# Deploy Results
186+
if [ "${{ inputs.publish_pages }}" = "false" ]; then
187+
echo "⏭️ **Deploy**: GitHub Pages deployment disabled" >> $GITHUB_STEP_SUMMARY
188+
echo "📦 **Artifact**: Documentation available as build artifact" >> $GITHUB_STEP_SUMMARY
189+
elif [ "${{ needs.deploy.result }}" = "success" ]; then
190+
echo "✅ **Deploy**: Successfully deployed to GitHub Pages" >> $GITHUB_STEP_SUMMARY
191+
if [ -n "${{ needs.deploy.outputs.page_url }}" ]; then
192+
echo "🌐 **URL**: ${{ needs.deploy.outputs.page_url }}" >> $GITHUB_STEP_SUMMARY
193+
fi
194+
else
195+
echo "❌ **Deploy**: Failed to deploy to GitHub Pages" >> $GITHUB_STEP_SUMMARY
196+
fi

0 commit comments

Comments
 (0)