Skip to content

Commit

Permalink
chore(ci): build images with dockerfile instead of ko
Browse files Browse the repository at this point in the history
Our Dockerfile includes our migrations and Atlas to execute those
migrations. However, the public image we are pushing is built with Ko
and excludes these files/tools. This commit switches gorelease to build
the image with the included Dockerfile.

Signed-off-by: Mikhail Swift <mikhail@testifysec.com>
  • Loading branch information
mikhailswift committed Jul 23, 2024
1 parent ef826f0 commit 18b613c
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 11 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ jobs:
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: Download GoReleaser
run: go install github.com/goreleaser/goreleaser@v1.23.0

Expand Down
60 changes: 49 additions & 11 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,56 @@ release:
prerelease: auto
github:
owner: "{{ .Env.GITHUB_REPOSITORY_OWNER }}"
dockers:
- image_templates:
- "ghcr.io/in-toto/archivista:{{ .Version }}-amd64"
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
extra_files:
- "archivista.graphql"
- "ent.graphql"
- "ent.resolvers.go"
- "entrypoint.sh"
- "gen.go"
- "generated.go"
- "go.mod"
- "go.sum"
- "resolver.go"
- "docs"
- "ent"
- "cmd"
- "ent"
- "pkg"
- image_templates:
- "ghcr.io/in-toto/archivista:{{ .Version }}-arm64"
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
extra_files:
- "archivista.graphql"
- "ent.graphql"
- "ent.resolvers.go"
- "entrypoint.sh"
- "gen.go"
- "generated.go"
- "go.mod"
- "go.sum"
- "resolver.go"
- "docs"
- "ent"
- "cmd"
- "ent"
- "pkg"
goarch: arm64
docker_manifests:
- name_template: "ghcr.io/in-toto/archivista:{{ .Version }}"
image_templates:
- "ghcr.io/in-toto/archivista:{{ .Version }}-amd64"
- "ghcr.io/in-toto/archivista:{{ .Version }}-arm64"
kos:
- repository: ghcr.io/in-toto/archivista
id: archivista
build: archivista
tags:
- '{{.Version}}'
bare: true
preserve_import_paths: false
creation_time: '{{.CommitTimestamp}}'
platforms:
- linux/amd64
- linux/arm64
- repository: ghcr.io/in-toto/archivistactl
id: archivistactl
build: archivistactl
Expand Down

0 comments on commit 18b613c

Please sign in to comment.