Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ jobs:
permissions:
contents: write
packages: write
strategy:
matrix:
image_type: [base, test]
include:
- image_type: base
dockerfile: Dockerfile
image_suffix: ""
- image_type: test
dockerfile: Dockerfile.test
image_suffix: "-test"

steps:
- name: Checkout code
Expand All @@ -37,7 +47,7 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}${{ matrix.image_suffix }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
Expand All @@ -49,14 +59,15 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
if: startsWith(github.ref, 'refs/tags/') && matrix.image_type == 'base'
uses: softprops/action-gh-release@v2
with:
files: ""
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ env/
ENV/

# IDE
.vscode/
.idea/
*.swp
*.swo
Expand All @@ -41,4 +40,3 @@ Thumbs.db

# MkDocs
site/

20 changes: 20 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"recommendations": [
"amazonwebservices.aws-toolkit-vscode",
"davidanson.vscode-markdownlint",
"eamodio.gitlens",
"esbenp.prettier-vscode",
"foxundermoon.shell-format",
"Gruntfuggly.todo-tree",
"hashicorp.terraform",
"mhutchie.git-graph",
"ms-vscode-remote.remote-ssh-edit",
"ms-vscode-remote.remote-ssh",
"ms-vscode.remote-containers",
"ms-vscode.vscode-json",
"redhat.vscode-yaml",
"streetsidesoftware.code-spell-checker",
"usernamehw.errorlens",
"vscode-icons-team.vscode-icons"
]
}
93 changes: 93 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"files.associations": {
"*.tf": "terraform",
"*.tfvars": "terraform",
"*.tfstate": "json",
"*.tfstate.backup": "json",
"*.hcl": "terraform",
"*.nomad": "hcl",
"*.consul": "hcl",
"*.vault": "hcl",
"*.dockerfile": "dockerfile",
"*.sh.tpl": "shellscript",
"docker-compose*.yml": "yaml",
"Dockerfile*": "dockerfile"
},
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/.terraform": true,
"**/.terraform.lock.hcl": true,
"**/terraform.tfstate*": true,
"**/.terraform.tfstate.lock.info": true,
"__debug_bin": true,
"vendor/": true,
"go.sum": true
},
"files.trimTrailingWhitespace": true,
"files.trimFinalNewlines": true,
"files.insertFinalNewline": true,
"files.autoSave": "onFocusChange",
"search.exclude": {
"**/.terraform": true,
"**/terraform.tfstate*": true,
"**/.terraform.tfstate.lock.info": true
},
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
},
"editor.rulers": [80, 120],
"editor.wordWrap": "wordWrapColumn",
"editor.wordWrapColumn": 120,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false,
"workbench.iconTheme": "vscode-icons",
"workbench.colorTheme": "Default Dark+",
"terraform.codelens.referenceCount": true,
"[terraform]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "hashicorp.terraform",
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false,
"editor.rulers": [80, 120],
"editor.wordWrap": "wordWrapColumn",
"editor.wordWrapColumn": 120
},
"[hcl]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "hashicorp.terraform",
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false
},
"[json]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.tabSize": 2,
"editor.insertSpaces": true
},
"[yaml]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "redhat.vscode-yaml",
"editor.tabSize": 2,
"editor.insertSpaces": true
},
"[shellscript]": {
"editor.defaultFormatter": "foxundermoon.shell-format",
"editor.tabSize": 2,
"editor.insertSpaces": true
},
"[markdown]": {
"editor.defaultFormatter": "davidanson.vscode-markdownlint",
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.wordWrap": "on"
}
}
41 changes: 41 additions & 0 deletions Dockerfile.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Stage 0: Build the base image locally
FROM python:3.13-slim AS base-builder

WORKDIR /tmp

# Install mkdocs and mkdocs-material
COPY requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt

# Stage 1: Build the documentation using the base image
FROM base-builder AS builder

WORKDIR /docs

# Copy the test documentation
COPY test/ /docs/

# Build the static site
RUN mkdocs build

# Stage 2: Serve the static site with nginx
FROM nginx:alpine

# Install wget for health check
RUN apk add --no-cache wget

# Copy the built site from builder stage
COPY --from=builder /docs/site /usr/share/nginx/html

# Create health check endpoint
RUN echo '{"status":"healthy"}' > /usr/share/nginx/html/health

# Configure nginx to listen on port 8000
RUN sed -i 's/listen 80;/listen 8000;/' /etc/nginx/conf.d/default.conf

# Expose port 8000 (same as base image)
EXPOSE 8000

# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:8000/health || exit 1