From 328e5807bd080e394004452590e25cd2a5013649 Mon Sep 17 00:00:00 2001 From: jessebot Date: Mon, 15 Jul 2024 10:25:38 +0200 Subject: [PATCH 1/5] add goreleaser file Signed-off-by: jessebot --- .gitignore | 2 ++ .goreleaser.yaml | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .goreleaser.yaml diff --git a/.gitignore b/.gitignore index 4630e77b..906af162 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ scratch/ build/ vault-helm/ + +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 00000000..e0219915 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,41 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com + +# The lines below are called `modelines`. See `:help modeline` +# Feel free to remove those if you don't want/need to use them. +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +version: 2 + +before: + hooks: + # You may remove this if you don't use go modules. + - go mod tidy + # you may remove this if you don't need go generate + - go generate ./... + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" From 01d97b7909d0e256601cc1a4148eb9d77f8742f8 Mon Sep 17 00:00:00 2001 From: jessebot Date: Mon, 15 Jul 2024 15:43:48 +0200 Subject: [PATCH 2/5] add docker stuff from the main openbao/openbao repo into the goreleaser.yaml Signed-off-by: jessebot --- .goreleaser.yaml | 356 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 356 insertions(+) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index e0219915..2c8a22dc 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -22,6 +22,320 @@ builds: - linux - darwin +dockers: + - id: alpine-amd64 + use: buildx + goos: linux + goarch: amd64 + skip_push: false + ids: + - builds-linux + build_flag_templates: + - "--pull" + - "--build-arg=BIN_NAME={{.ProjectName}}" + - "--build-arg=REVISION={{.FullCommit}}" + - "--build-arg=VERSION={{.Version}}" + - "--platform=linux/amd64" + - "--label=org.opencontainers.image.title={{ .ProjectName }}" + - "--label=org.opencontainers.image.vendor=OpenBao" + - "--label=org.opencontainers.image.description=OpenBao K8s {{ .Version }}" + - "--label=org.opencontainers.image.url=https://github.com/openbao/openbao-k8s" + - "--label=org.opencontainers.image.documentation=https://github.com/openbao/openbao-k8s/blob/main/README.md" + - "--label=org.opencontainers.image.source=https://github.com/openbao/openbao-k8s" + - "--label=org.opencontainers.image.licenses=MPL-2.0" + - "--label=org.opencontainers.image.version={{ .Version }}" + - "--label=org.opencontainers.image.revision={{ .FullCommit }}" + - '--label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}' + - "--label=release={{ .Version }}" + - "--label=revision={{ .FullCommit }}" + - "--label=version={{ .Version }}" + - "--target=default" + image_templates: + - "ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-amd64" + - "quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-amd64" + - "docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-amd64" + extra_files: + - ./LICENSE + - ./.release/docker/docker-entrypoint.sh + - ./CHANGELOG.md + - id: alpine-arm + use: buildx + goos: linux + goarch: arm + goarm: "6" + skip_push: false + ids: + - builds-linux + build_flag_templates: + - "--pull" + - "--build-arg=BIN_NAME={{ .ProjectName }}" + - "--build-arg=REVISION={{ .FullCommit }}" + - "--build-arg=VERSION={{ .Version }}" + - "--platform=linux/arm" + - "--label=org.opencontainers.image.title={{ .ProjectName }}" + - "--label=org.opencontainers.image.vendor=OpenBao" + - "--label=org.opencontainers.image.description=OpenBao K8s {{ .Version }}" + - "--label=org.opencontainers.image.url=https://github.com/openbao/openbao-k8s" + - "--label=org.opencontainers.image.documentation=https://github.com/openbao/openbao-k8s/blob/main/README.md" + - "--label=org.opencontainers.image.source=https://github.com/openbao/openbao-k8s" + - "--label=org.opencontainers.image.licenses=MPL-2.0" + - "--label=org.opencontainers.image.version={{ .Version }}" + - "--label=org.opencontainers.image.revision={{ .FullCommit }}" + - '--label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}' + - "--label=release={{ .Version }}" + - "--label=revision={{ .FullCommit }}" + - "--label=version={{ .Version }}" + - "--target=default" + image_templates: + - "ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm" + - "quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm" + - "docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm" + extra_files: + - ./LICENSE + - ./.release/docker/docker-entrypoint.sh + - ./CHANGELOG.md + - id: alpine-arm64 + use: buildx + goos: linux + goarch: arm64 + goarm: "8" + skip_push: false + ids: + - builds-linux + build_flag_templates: + - "--pull" + - "--build-arg=BIN_NAME={{ .ProjectName }}" + - "--build-arg=REVISION={{ .FullCommit }}" + - "--build-arg=VERSION={{ .Version }}" + - "--platform=linux/arm64" + - "--label=org.opencontainers.image.title={{ .ProjectName }}" + - "--label=org.opencontainers.image.vendor=OpenBao" + - "--label=org.opencontainers.image.description=OpenBao K8s {{ .Version }}" + - "--label=org.opencontainers.image.url=https://github.com/openbao/openbao-k8s" + - "--label=org.opencontainers.image.documentation=https://github.com/openbao/openbao-k8s/blob/main/README.md" + - "--label=org.opencontainers.image.source=https://github.com/openbao/openbao-k8s" + - "--label=org.opencontainers.image.licenses=MPL-2.0" + - "--label=org.opencontainers.image.version={{ .Version }}" + - "--label=org.opencontainers.image.revision={{ .FullCommit }}" + - '--label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}' + - "--label=release={{ .Version }}" + - "--label=revision={{ .FullCommit }}" + - "--label=version={{ .Version }}" + - "--target=default" + image_templates: + - "ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm64" + - "quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm64" + - "docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm64" + extra_files: + - ./LICENSE + - ./.release/docker/docker-entrypoint.sh + - ./CHANGELOG.md + - id: ubi-amd64 + use: buildx + goos: linux + goarch: amd64 + skip_push: false + ids: + - builds-linux + build_flag_templates: + - "--pull" + - "--build-arg=BIN_NAME={{ .ProjectName }}" + - "--build-arg=REVISION={{ .FullCommit }}" + - "--build-arg=VERSION={{ .Version }}" + - "--platform=linux/amd64" + - "--label=org.opencontainers.image.title={{ .ProjectName }}" + - "--label=org.opencontainers.image.vendor=OpenBao" + - "--label=org.opencontainers.image.description=OpenBao K8s {{ .Version }}" + - "--label=org.opencontainers.image.url=https://github.com/openbao/openbao-k8s" + - "--label=org.opencontainers.image.documentation=https://github.com/openbao/openbao-k8s/blob/main/README.md" + - "--label=org.opencontainers.image.source=https://github.com/openbao/openbao-k8s" + - "--label=org.opencontainers.image.licenses=MPL-2.0" + - "--label=org.opencontainers.image.version={{ .Version }}" + - "--label=org.opencontainers.image.revision={{ .FullCommit }}" + - '--label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}' + - "--label=release={{ .Version }}" + - "--label=revision={{ .FullCommit }}" + - "--label=version={{ .Version }}" + - "--target=ubi" + image_templates: + - "ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64" + - "quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64" + - "docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64" + extra_files: + - ./LICENSE + - ./.release/docker/ubi-docker-entrypoint.sh + - ./CHANGELOG.md + - id: ubi-arm64 + use: buildx + goos: linux + goarch: arm64 + goarm: "8" + skip_push: false + ids: + - builds-linux + build_flag_templates: + - "--pull" + - "--build-arg=BIN_NAME={{ .ProjectName }}" + - "--build-arg=REVISION={{ .FullCommit }}" + - "--build-arg=VERSION={{ .Version }}" + - "--platform=linux/arm64" + - "--label=org.opencontainers.image.title={{ .ProjectName }}" + - "--label=org.opencontainers.image.vendor=OpenBao" + - "--label=org.opencontainers.image.description=OpenBao K8s {{ .Version }}" + - "--label=org.opencontainers.image.url=https://github.com/openbao/openbao-k8s" + - "--label=org.opencontainers.image.documentation=https://github.com/openbao/openbao-k8s/blob/main/README.md" + - "--label=org.opencontainers.image.source=https://github.com/openbao/openbao-k8s" + - "--label=org.opencontainers.image.licenses=MPL-2.0" + - "--label=org.opencontainers.image.version={{ .Version }}" + - "--label=org.opencontainers.image.revision={{ .FullCommit }}" + - '--label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}' + - "--label=release={{ .Version }}" + - "--label=revision={{ .FullCommit }}" + - "--label=version={{ .Version }}" + - "--target=ubi" + image_templates: + - "ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64" + - "quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64" + - "docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64" + extra_files: + - ./LICENSE + - ./.release/docker/ubi-docker-entrypoint.sh + - ./CHANGELOG.md + +docker_manifests: + - name_template: ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }} + skip_push: false + image_templates: + - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-amd64 + - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm + - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm64 + - name_template: ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Major }}.{{ .Minor }} + skip_push: false + image_templates: + - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-amd64 + - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm + - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm64 + - name_template: ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Major }} + skip_push: false + image_templates: + - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-amd64 + - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm + - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm64 + - name_template: ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:latest + skip_push: false + image_templates: + - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-amd64 + - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm + - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm64 + - name_template: ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }} + skip_push: false + image_templates: + - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 + - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 + - name_template: ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Major }}.{{ .Minor }} + skip_push: false + image_templates: + - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 + - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 + - name_template: ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Major }} + skip_push: false + image_templates: + - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 + - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 + - name_template: ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:latest + skip_push: false + image_templates: + - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 + - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 + - name_template: docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }} + skip_push: false + image_templates: + - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-amd64 + - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm + - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm64 + - name_template: docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Major }}.{{ .Minor }} + skip_push: false + image_templates: + - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-amd64 + - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm + - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm64 + - name_template: docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Major }} + skip_push: false + image_templates: + - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-amd64 + - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm + - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm64 + - name_template: docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:latest + skip_push: false + image_templates: + - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-amd64 + - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm + - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm64 + - name_template: docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }} + skip_push: false + image_templates: + - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 + - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 + - name_template: docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Major }}.{{ .Minor }} + skip_push: false + image_templates: + - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 + - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 + - name_template: docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Major }} + skip_push: false + image_templates: + - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 + - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 + - name_template: docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:latest + skip_push: false + image_templates: + - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 + - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 + - name_template: quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }} + skip_push: false + image_templates: + - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-amd64 + - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm + - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm64 + - name_template: quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Major }}.{{ .Minor }} + skip_push: false + image_templates: + - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-amd64 + - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm + - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm64 + - name_template: quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Major }} + skip_push: false + image_templates: + - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-amd64 + - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm + - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm64 + - name_template: quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:latest + skip_push: false + image_templates: + - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-amd64 + - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm + - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm64 + - name_template: quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }} + skip_push: false + image_templates: + - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 + - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 + - name_template: quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Major }}.{{ .Minor }} + skip_push: false + image_templates: + - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 + - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 + - name_template: quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Major }} + skip_push: false + image_templates: + - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 + - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 + - name_template: quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:latest + skip_push: false + image_templates: + - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 + - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 + archives: - format: tar.gz # this name template makes the OS and Arch compatible with the results of `uname`. @@ -39,3 +353,45 @@ changelog: exclude: - "^docs:" - "^test:" + +signs: + - id: cosign + artifacts: all + cmd: cosign + certificate: "${artifact}.pem" + args: + - "sign-blob" + - "--oidc-issuer=https://token.actions.githubusercontent.com" + - "--output-certificate=${certificate}" + - "--output-signature=${signature}" + - "${artifact}" + - "--yes" # needed on cosign 2.0.0+ + - id: gpg + artifacts: all + signature: "${artifact}.gpgsig" + cmd: gpg + stdin: "{{ .Env.GPG_PASSWORD }}" + args: + - "--batch" + - "--default-key={{ .Env.GPG_FINGERPRINT }}" + - "--output=${signature}" + - "--detach-sign" + - "${artifact}" + +docker_signs: + - artifacts: all + args: + - "sign" + - "--oidc-issuer=https://token.actions.githubusercontent.com" + - "${artifact}@${digest}" + - "--yes" # needed on cosign 2.0.0+ + +release: + github: + owner: openbao + name: openbao-k8s + draft: true #${{ .Env.GITHUB_RELEASE_DRAFT }} + replace_existing_draft: false + prerelease: ${{ .Env.GITHUB_PRERELEASE }} + make_latest: ${{ .Env.GITHUB_RELEASE_MAKE_LATEST }} + disable: false From f359dd1f1762dc90b838e5e5b2ff83b22e7e4e40 Mon Sep 17 00:00:00 2001 From: jessebot Date: Mon, 15 Jul 2024 16:02:18 +0200 Subject: [PATCH 3/5] remove ubi images from goreleaser.yaml Signed-off-by: jessebot --- .goreleaser.yaml | 131 ----------------------------------------------- 1 file changed, 131 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 2c8a22dc..5499eaeb 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -130,77 +130,6 @@ dockers: - ./LICENSE - ./.release/docker/docker-entrypoint.sh - ./CHANGELOG.md - - id: ubi-amd64 - use: buildx - goos: linux - goarch: amd64 - skip_push: false - ids: - - builds-linux - build_flag_templates: - - "--pull" - - "--build-arg=BIN_NAME={{ .ProjectName }}" - - "--build-arg=REVISION={{ .FullCommit }}" - - "--build-arg=VERSION={{ .Version }}" - - "--platform=linux/amd64" - - "--label=org.opencontainers.image.title={{ .ProjectName }}" - - "--label=org.opencontainers.image.vendor=OpenBao" - - "--label=org.opencontainers.image.description=OpenBao K8s {{ .Version }}" - - "--label=org.opencontainers.image.url=https://github.com/openbao/openbao-k8s" - - "--label=org.opencontainers.image.documentation=https://github.com/openbao/openbao-k8s/blob/main/README.md" - - "--label=org.opencontainers.image.source=https://github.com/openbao/openbao-k8s" - - "--label=org.opencontainers.image.licenses=MPL-2.0" - - "--label=org.opencontainers.image.version={{ .Version }}" - - "--label=org.opencontainers.image.revision={{ .FullCommit }}" - - '--label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}' - - "--label=release={{ .Version }}" - - "--label=revision={{ .FullCommit }}" - - "--label=version={{ .Version }}" - - "--target=ubi" - image_templates: - - "ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64" - - "quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64" - - "docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64" - extra_files: - - ./LICENSE - - ./.release/docker/ubi-docker-entrypoint.sh - - ./CHANGELOG.md - - id: ubi-arm64 - use: buildx - goos: linux - goarch: arm64 - goarm: "8" - skip_push: false - ids: - - builds-linux - build_flag_templates: - - "--pull" - - "--build-arg=BIN_NAME={{ .ProjectName }}" - - "--build-arg=REVISION={{ .FullCommit }}" - - "--build-arg=VERSION={{ .Version }}" - - "--platform=linux/arm64" - - "--label=org.opencontainers.image.title={{ .ProjectName }}" - - "--label=org.opencontainers.image.vendor=OpenBao" - - "--label=org.opencontainers.image.description=OpenBao K8s {{ .Version }}" - - "--label=org.opencontainers.image.url=https://github.com/openbao/openbao-k8s" - - "--label=org.opencontainers.image.documentation=https://github.com/openbao/openbao-k8s/blob/main/README.md" - - "--label=org.opencontainers.image.source=https://github.com/openbao/openbao-k8s" - - "--label=org.opencontainers.image.licenses=MPL-2.0" - - "--label=org.opencontainers.image.version={{ .Version }}" - - "--label=org.opencontainers.image.revision={{ .FullCommit }}" - - '--label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}' - - "--label=release={{ .Version }}" - - "--label=revision={{ .FullCommit }}" - - "--label=version={{ .Version }}" - - "--target=ubi" - image_templates: - - "ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64" - - "quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64" - - "docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64" - extra_files: - - ./LICENSE - - ./.release/docker/ubi-docker-entrypoint.sh - - ./CHANGELOG.md docker_manifests: - name_template: ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }} @@ -227,26 +156,6 @@ docker_manifests: - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-amd64 - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm64 - - name_template: ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }} - skip_push: false - image_templates: - - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 - - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 - - name_template: ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Major }}.{{ .Minor }} - skip_push: false - image_templates: - - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 - - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 - - name_template: ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Major }} - skip_push: false - image_templates: - - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 - - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 - - name_template: ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:latest - skip_push: false - image_templates: - - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 - - ghcr.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 - name_template: docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }} skip_push: false image_templates: @@ -271,26 +180,6 @@ docker_manifests: - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-amd64 - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm64 - - name_template: docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }} - skip_push: false - image_templates: - - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 - - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 - - name_template: docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Major }}.{{ .Minor }} - skip_push: false - image_templates: - - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 - - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 - - name_template: docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Major }} - skip_push: false - image_templates: - - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 - - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 - - name_template: docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:latest - skip_push: false - image_templates: - - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 - - docker.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 - name_template: quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }} skip_push: false image_templates: @@ -315,26 +204,6 @@ docker_manifests: - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-amd64 - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s:{{ .Version }}-arm64 - - name_template: quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }} - skip_push: false - image_templates: - - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 - - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 - - name_template: quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Major }}.{{ .Minor }} - skip_push: false - image_templates: - - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 - - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 - - name_template: quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Major }} - skip_push: false - image_templates: - - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 - - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 - - name_template: quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:latest - skip_push: false - image_templates: - - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-amd64 - - quay.io/{{ .Env.GITHUB_REPOSITORY_OWNER }}/openbao-k8s-ubi:{{ .Version }}-arm64 archives: - format: tar.gz From 90bd7c17efd23396f70dafa3d40ff34eae0026b1 Mon Sep 17 00:00:00 2001 From: jessebot Date: Mon, 15 Jul 2024 17:28:17 +0200 Subject: [PATCH 4/5] update registry in Makefile to be docker.io/openbao Signed-off-by: jessebot --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a28c1146..ddddb476 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -REGISTRY_NAME ?= docker.io/hashicorp +REGISTRY_NAME ?= docker.io/openbao IMAGE_NAME = openbao-k8s VERSION ?= 0.0.0-dev OPENBAO_VERSION ?= 1.16.1 From bd4c1f374a3b4823daa32870871333c4762016a1 Mon Sep 17 00:00:00 2001 From: jessebot Date: Mon, 15 Jul 2024 17:40:03 +0200 Subject: [PATCH 5/5] update hashicorp versions to openbao versions change openbao version to v2.0.0-beta20240618 change openbao helm chart version to 0.4.0 remove TODO: add support testing againster enterprise; there is no enterprise remove PUBLISH_LOCATION ?= https://releases.hashicorp.com fix helm chart repo in OPENBAO_HELM_DEFAULT_ARGS Signed-off-by: jessebot --- Makefile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index ddddb476..94229f15 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,8 @@ REGISTRY_NAME ?= docker.io/openbao IMAGE_NAME = openbao-k8s VERSION ?= 0.0.0-dev -OPENBAO_VERSION ?= 1.16.1 +OPENBAO_VERSION ?= v2.0.0-beta20240618 IMAGE_TAG ?= $(REGISTRY_NAME)/$(IMAGE_NAME):$(VERSION) -PUBLISH_LOCATION ?= https://releases.hashicorp.com DOCKER_DIR = ./build/docker BUILD_DIR = dist GOOS ?= linux @@ -15,8 +14,7 @@ PKG = github.com/openbao/openbao-k8s/version LDFLAGS ?= "-X '$(PKG).Version=v$(VERSION)'" TESTARGS ?= '-test.v' -OPENBAO_HELM_CHART_VERSION ?= 0.27.0 -# TODO: add support for testing against enterprise +OPENBAO_HELM_CHART_VERSION ?= 0.4.0 TEST_WITHOUT_OPENBAO_TLS ?= ifndef TEST_WITHOUT_OPENBAO_TLS @@ -31,7 +29,7 @@ ifdef TEST_WITHOUT_OPENBAO_TLS HELM_VALUES_FILE = test/openbao/dev-no-tls.values.yaml endif -OPENBAO_HELM_DEFAULT_ARGS ?= --repo https://helm.releases.hashicorp.com --version=$(OPENBAO_HELM_CHART_VERSION) \ +OPENBAO_HELM_DEFAULT_ARGS ?= --repo https://openbao.github.io/openbao-helm --version=$(OPENBAO_HELM_CHART_VERSION) \ --wait --timeout=5m \ --values=$(HELM_VALUES_FILE) \ --set server.image.tag=$(OPENBAO_VERSION) \