This repository was archived by the owner on Aug 12, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/versioned releases #6
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
bf45dac
fix: enforce required environment variables in configuration & pass t…
RepoRover 3400ccb
fix: reorder top-level keys in generated schemas to prioritize $id an…
RepoRover baa420c
fix: moved description field from snapshot to schema definition
RepoRover 26e75b9
fix: enable overriding of environment variables when loading .env file
RepoRover 1d2232d
feat: add Dockerfile, .dockerignore for schema generation and workflo…
RepoRover dc1ab34
feat: added workflow to create production images & cleaned workflow t…
RepoRover 5c6c3d9
Merge pull request #7 from Bfloo-App/docker-utilisation
RepoRover d1349c5
refactor(config): Remove unecessary python-dotenv dependency
Matheus-OAMK 8da6dff
refactor(Dockerfile): Pin UV version and simplify building stage
Matheus-OAMK 4acb743
refactor(config): Remove leftover comments
Matheus-OAMK b02025d
Merge pull request #8 from Bfloo-App/refactor/dot-env
RepoRover File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| # Version control | ||
| .git | ||
| .gitignore | ||
| .gitattributes | ||
|
|
||
| # Python artifacts | ||
| __pycache__ | ||
| *.pyc | ||
| *.pyo | ||
| *.pyd | ||
| .Python | ||
| .venv | ||
| .venv/ | ||
| .python-version | ||
| pip-log.txt | ||
| pip-delete-this-directory.txt | ||
|
|
||
| # Development and testing | ||
| tests/ | ||
| .pytest_cache/ | ||
| .coverage | ||
| .coverage.* | ||
| coverage.xml | ||
| htmlcov/ | ||
| .tox/ | ||
| .nox/ | ||
| .cache | ||
| .mypy_cache/ | ||
| .ruff_cache/ | ||
| .pyright/ | ||
| .pre-commit-config.yaml | ||
| .env.example | ||
|
|
||
| # IDE and editor files | ||
| .vscode/ | ||
| .idea/ | ||
| *.swp | ||
| *.swo | ||
| *~ | ||
|
|
||
| # OS generated files | ||
| .DS_Store | ||
| .DS_Store? | ||
| ._* | ||
| .Spotlight-V100 | ||
| .Trashes | ||
| ehthumbs.db | ||
| Thumbs.db | ||
|
|
||
| # Documentation (optional, remove if needed in image) | ||
| README.md | ||
| docs/README.md | ||
|
|
||
| # CI/CD | ||
| .github/ | ||
|
|
||
| # Build artifacts | ||
| build/ | ||
| dist/ | ||
| *.egg-info/ | ||
|
|
||
| # Logs | ||
| *.log | ||
| logs/ | ||
|
|
||
| # Temporary files | ||
| .tmp/ | ||
| temp/ | ||
| *.tmp | ||
|
|
||
| # Node modules (if any) | ||
| node_modules/ | ||
|
|
||
| # Docker | ||
| Dockerfile* | ||
| docker-compose*.yml | ||
| .dockerignore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| name: "Production CI/CD - Create Release Image" | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| # Run on every tag matching this pattern (e.g. v1.4.0) | ||
| - v[0-9]*.[0-9]*.[0-9]* | ||
| - "!v[0-9]*.[0-9]*.[0-9]*-rc.[0-9]*" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| quality_checks: | ||
| uses: ./.github/workflows/ci.yaml | ||
|
|
||
| prepare_metadata: | ||
| runs-on: ubuntu-latest | ||
| needs: quality_checks | ||
| outputs: | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5.0.0 | ||
| with: | ||
| ref: ${{ github.ref }} | ||
|
|
||
| - name: Extract metadata | ||
| id: meta | ||
| uses: docker/metadata-action@v5.8.0 | ||
| with: | ||
| images: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }} | ||
| tags: | | ||
| type=ref,event=tag,enable=true | ||
|
|
||
| flavor: | | ||
| latest=true | ||
|
|
||
| labels: | | ||
| org.opencontainers.image.title=${{ github.event.repository.name }} | ||
| org.opencontainers.image.description=${{ github.event.repository.description }} | ||
| org.opencontainers.image.url=${{ github.event.repository.html_url }} | ||
| org.opencontainers.image.source=${{ github.event.repository.clone_url }} | ||
| org.opencontainers.image.version=${{ github.ref_name }} | ||
| org.opencontainers.image.revision=${{ github.sha }} | ||
|
|
||
| build_image: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| packages: write | ||
| contents: read | ||
|
|
||
| environment: production | ||
| needs: [quality_checks, prepare_metadata] | ||
| outputs: | ||
| image-url: ghcr.io/${{ github.repository_owner}}/${{ github.repository }}:${{ github.ref_name }} | ||
| image-id: ${{ steps.build.outputs.imageid }} | ||
| digest: ${{ steps.build.outputs.digest }} | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5.0.0 | ||
| with: | ||
| ref: ${{ github.ref }} | ||
|
|
||
| - name: Generate env file | ||
| run: | | ||
| echo "BASE_URL=${{ vars.BASE_URL }}" >> .env | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3.11.1 | ||
| with: | ||
| platforms: linux/amd64 | ||
|
|
||
| - name: Restore Docker cache | ||
| uses: actions/cache@v4.2.4 | ||
| with: | ||
| path: /tmp/.buildx-cache | ||
| key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-buildx- | ||
|
|
||
| - name: Login to GHCR | ||
| uses: docker/login-action@v3.5.0 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Build and push Docker image | ||
| id: build | ||
| uses: docker/build-push-action@v6.18.0 | ||
| with: | ||
| context: . | ||
| push: true | ||
| tags: ${{ needs.prepare_metadata.outputs.tags }} | ||
| labels: ${{ needs.prepare_metadata.outputs.labels }} | ||
| platforms: linux/amd64 | ||
| provenance: false | ||
| sbom: false | ||
| cache-from: | | ||
| type=gha | ||
| type=local,src=/tmp/.buildx-cache | ||
|
|
||
| cache-to: | | ||
| type=gha,mode=max | ||
| type=local,dest=/tmp/.buildx-cache-updated,mode=max | ||
|
|
||
| build-args: | | ||
| BUILDKIT_INLINE_CACHE=1 | ||
|
|
||
| - name: Update cache | ||
| run: | | ||
| rm -rf /tmp/.buildx-cache | ||
| mv /tmp/.buildx-cache-updated /tmp/.buildx-cache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| name: "Staging CI/CD - Create Release Candidate Image" | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| # Run on every tag matching this pattern (e.g. v1.4.0-rc.1) | ||
| - "v[0-9]*.[0-9]*.[0-9]*-rc.[0-9]*" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| quality_checks: | ||
| uses: ./.github/workflows/ci.yaml | ||
|
|
||
| prepare_metadata: | ||
| runs-on: ubuntu-latest | ||
| needs: quality_checks | ||
| outputs: | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5.0.0 | ||
| with: | ||
| ref: ${{ github.ref }} | ||
|
|
||
| - name: Extract metadata | ||
| id: meta | ||
| uses: docker/metadata-action@v5.8.0 | ||
| with: | ||
| images: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }} | ||
| tags: | | ||
| type=ref,event=tag,enable=true | ||
| type=raw,value=staging-latest | ||
|
|
||
| flavor: | | ||
| latest=false | ||
|
|
||
| labels: | | ||
| org.opencontainers.image.title=${{ github.event.repository.name }} | ||
| org.opencontainers.image.description=${{ github.event.repository.description }} | ||
| org.opencontainers.image.url=${{ github.event.repository.html_url }} | ||
| org.opencontainers.image.source=${{ github.event.repository.clone_url }} | ||
| org.opencontainers.image.version=${{ github.ref_name }} | ||
| org.opencontainers.image.revision=${{ github.sha }} | ||
|
|
||
| build_image: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
|
||
| environment: staging | ||
| needs: [quality_checks, prepare_metadata] | ||
| outputs: | ||
| image-url: ghcr.io/${{ github.repository_owner}}/${{ github.repository }}:${{ github.ref_name }} | ||
| image-id: ${{ steps.build.outputs.imageid }} | ||
| digest: ${{ steps.build.outputs.digest }} | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5.0.0 | ||
| with: | ||
| ref: ${{ github.ref }} | ||
|
|
||
| - name: Generate env file | ||
| run: | | ||
| echo "BASE_URL=${{ vars.BASE_URL }}" >> .env | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3.11.1 | ||
| with: | ||
| platforms: linux/amd64 | ||
|
|
||
| - name: Restore Docker cache | ||
| uses: actions/cache@v4.2.4 | ||
| with: | ||
| path: /tmp/.buildx-cache | ||
| key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-buildx- | ||
|
|
||
| - name: Login to GHCR | ||
| uses: docker/login-action@v3.5.0 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Build and push Docker image | ||
| id: build | ||
| uses: docker/build-push-action@v6.18.0 | ||
| with: | ||
| context: . | ||
| push: true | ||
| tags: ${{ needs.prepare_metadata.outputs.tags }} | ||
| labels: ${{ needs.prepare_metadata.outputs.labels }} | ||
| platforms: linux/amd64 | ||
| provenance: false | ||
| sbom: false | ||
| cache-from: | | ||
| type=gha | ||
| type=local,src=/tmp/.buildx-cache | ||
|
|
||
| cache-to: | | ||
| type=gha,mode=max | ||
| type=local,dest=/tmp/.buildx-cache-updated,mode=max | ||
|
|
||
| build-args: | | ||
| BUILDKIT_INLINE_CACHE=1 | ||
|
|
||
| - name: Update cache | ||
| run: | | ||
| rm -rf /tmp/.buildx-cache | ||
| mv /tmp/.buildx-cache-updated /tmp/.buildx-cache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Multi-stage build for database schema spec generator | ||
| # Stage 1: Build the schemas | ||
| FROM ghcr.io/astral-sh/uv:0.8.13-alpine3.22 AS builder | ||
|
|
||
| # Set working directory | ||
| WORKDIR /app | ||
|
|
||
| # Copy dependency files first for better caching | ||
| COPY pyproject.toml uv.lock ./ | ||
|
|
||
| # Install dependencies | ||
| RUN uv sync --frozen --no-install-project --no-dev | ||
|
|
||
| # Copy source code and input files | ||
| COPY main.py ./ | ||
| COPY database_schema_spec/ ./database_schema_spec/ | ||
| COPY docs/ ./docs/ | ||
| COPY .env ./ | ||
|
|
||
| # Generate the schemas | ||
| RUN uv run python main.py | ||
|
|
||
| # Stage 2: Final lightweight image with only the output | ||
| FROM alpine:3.22 AS final | ||
|
|
||
| # Create output directory | ||
| RUN mkdir -p /output | ||
|
|
||
| # Copy generated schemas from builder stage | ||
| COPY --from=builder /app/output/ /output/ | ||
|
|
||
| # Optional: Set a default command to list contents (for debugging) | ||
| CMD ["ls", "-la", "/output"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -150,5 +150,5 @@ output/ | |
| ├── vmap.json | ||
| └── postgresql/ | ||
| └── 15.0/ | ||
| └── unified_schema.json | ||
| └── spec.json | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.