From 50a9d0ddde4faa72eae4d81e904b766114714cb6 Mon Sep 17 00:00:00 2001 From: Patrice Ferlet Date: Sun, 3 Aug 2025 22:53:53 +0200 Subject: [PATCH 1/3] feat(md): fixes typo and rules --- README.md | 2 +- doc/docs/.markdownlint.yaml | 3 +++ doc/docs/dependencies.md | 8 ++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d4e93a2..a8f3797 100644 --- a/README.md +++ b/README.md @@ -186,7 +186,7 @@ services: database: image: mariadb:10 env_file: - # this valuse will be added in a configMap + # this values will be added in a configMap - my_env.env environment: MARIADB_USER: foo diff --git a/doc/docs/.markdownlint.yaml b/doc/docs/.markdownlint.yaml index ccc15b1..d246b85 100644 --- a/doc/docs/.markdownlint.yaml +++ b/doc/docs/.markdownlint.yaml @@ -4,3 +4,6 @@ MD022: false MD033: false MD041: false MD046: false +# list indentation +MD007: + indent: 4 diff --git a/doc/docs/dependencies.md b/doc/docs/dependencies.md index c18f8da..b0a0a9e 100644 --- a/doc/docs/dependencies.md +++ b/doc/docs/dependencies.md @@ -3,14 +3,14 @@ Katenary uses `compose-go` and several Kubernetes official packages. - `github.com/compose-spec/compose-go`: to parse compose files. It ensures : - - that the project respects the "compose" specification - - that Katenary uses the "compose" struct exactly the same way `podman compose` or `docker copose` does + - that the project respects the "compose" specification + - that Katenary uses the "compose" struct exactly the same way `podman compose` or `docker compose` does - `github.com/spf13/cobra`: to parse command line arguments, sub-commands and flags. It also generates completion for bash, zsh, fish and PowerShell. - `github.com/thediveo/netdb`: to get the standard names of a service from its port number - `gopkg.in/yaml.v3`: - - to generate `Chart.yaml` and `values.yaml` files (only) - - to parse Katenary labels in the compose file + - to generate `Chart.yaml` and `values.yaml` files (only) + - to parse Katenary labels in the compose file - `k8s.io/api` and `k8s.io/apimachinery` to create Kubernetes objects - `sigs.k8s.io/yaml`: to generate Katenary YAML files in the format of Kubernetes objects -- 2.49.1 From 0f3812b666f5f096d755d48de5b1aa370d73fcea Mon Sep 17 00:00:00 2001 From: Patrice Ferlet Date: Sun, 3 Aug 2025 22:27:24 +0200 Subject: [PATCH 2/3] feat(oci): Add OCI image generation Not fully tested but it should produce an image in ghcr.io --- .github/workflows/build-oci.yaml | 38 ++++++++++++++++++++++++++++++++ .gitignore | 1 + oci/katenary/Containerfile | 15 +++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 .github/workflows/build-oci.yaml create mode 100644 oci/katenary/Containerfile diff --git a/.github/workflows/build-oci.yaml b/.github/workflows/build-oci.yaml new file mode 100644 index 0000000..c14e0d2 --- /dev/null +++ b/.github/workflows/build-oci.yaml @@ -0,0 +1,38 @@ +name: Build OCI image + +on: + release: + types: + - published + + push: + branches: + - "features/**" +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + file: ./oci/katenary/Containerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.gitignore b/.gitignore index 0fe6554..972ace2 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ __pycache__ # local binaries katenary !cmd/katenary +!oci/katenary diff --git a/oci/katenary/Containerfile b/oci/katenary/Containerfile new file mode 100644 index 0000000..1ad4387 --- /dev/null +++ b/oci/katenary/Containerfile @@ -0,0 +1,15 @@ +ARG GOVERSION=1.24 + +FROM docker.io/golang:${GOVERSION} AS builder +ARG VERSION=master +RUN set -xe; \ + CGO_ENABLED=0 go install -v github.com/katenary/katenary/cmd/katenary@$VERSION; + +FROM scratch +LABEL org.opencontainers.image.source=https://github.com/katenary/katenary +LABEL org.opencontainers.image.description="Katenary converts compose files to Helm Chart" +LABEL org.opencontainers.image.licenses=MIT +COPY --from=builder /go/bin/katenary /usr/local/bin/katenary +VOLUME /project +WORKDIR /project +ENTRYPOINT ["/usr/local/bin/katenary"] -- 2.49.1 From 07263520b6506f99a0954eb9cb7c22d4a0dc3309 Mon Sep 17 00:00:00 2001 From: Patrice Ferlet Date: Sun, 3 Aug 2025 23:01:54 +0200 Subject: [PATCH 3/3] feat(oci): remove testing on push branches --- .github/workflows/build-oci.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-oci.yaml b/.github/workflows/build-oci.yaml index c14e0d2..bef883e 100644 --- a/.github/workflows/build-oci.yaml +++ b/.github/workflows/build-oci.yaml @@ -5,9 +5,6 @@ on: types: - published - push: - branches: - - "features/**" env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} @@ -36,3 +33,5 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + build-args: | + VERSION=${{github.ref_name}} -- 2.49.1