mirror of
https://github.com/foomo/sesamy-cli.git
synced 2025-10-16 12:35:36 +00:00
chore: add docker
This commit is contained in:
parent
c3a1a68c9b
commit
df04a14c25
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
||||
sesamy
|
||||
dist
|
||||
9
.github/workflows/release.yml
vendored
9
.github/workflows/release.yml
vendored
@ -22,15 +22,22 @@ jobs:
|
||||
check-latest: true
|
||||
go-version-file: go.mod
|
||||
|
||||
- uses: docker/setup-qemu-action@v3
|
||||
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
|
||||
- id: app_token
|
||||
uses: tibdex/github-app-token@v2
|
||||
with:
|
||||
app_id: ${{ secrets.TOKEN_APP_ID }}
|
||||
private_key: ${{ secrets.TOKEN_APP_PRIVATE_KEY }}
|
||||
|
||||
- name: Login to docker.io
|
||||
run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- uses: goreleaser/goreleaser-action@v6
|
||||
with:
|
||||
version: latest
|
||||
version: '~> v2'
|
||||
args: release --clean
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.app_token.outputs.token }}
|
||||
|
||||
9
.gitignore
vendored
9
.gitignore
vendored
@ -16,13 +16,18 @@
|
||||
## Editorconfig
|
||||
!.editorconfig
|
||||
|
||||
## Ownbrew
|
||||
!.ownbrew.yaml
|
||||
## Docker
|
||||
!.dockerignore
|
||||
|
||||
## Husky
|
||||
!.husky/
|
||||
!.husky.yaml
|
||||
|
||||
## Golang
|
||||
go.work
|
||||
go.work.sum
|
||||
!.golangci.yml
|
||||
!.goreleaser.yml
|
||||
|
||||
## Ownbrew
|
||||
!.ownbrew.yaml
|
||||
|
||||
@ -41,3 +41,74 @@ brews:
|
||||
description: "CLI utitlity to manage Server Side Tag Management"
|
||||
test: |
|
||||
system "#{bin}/sesamy --version"
|
||||
|
||||
dockers:
|
||||
- use: buildx
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
dockerfile: Dockerfile
|
||||
image_templates:
|
||||
- '{{ if eq .Prerelease "" }}foomo/sesamy:latest-amd64{{ end }}'
|
||||
- 'foomo/sesamy:{{ .Version }}-amd64'
|
||||
- '{{ if eq .Prerelease "" }}foomo/sesamy:{{ .Major }}-amd64{{ end }}'
|
||||
- '{{ if eq .Prerelease "" }}foomo/sesamy:{{ .Major }}.{{ .Minor }}-amd64{{ end }}'
|
||||
build_flag_templates:
|
||||
- '--pull'
|
||||
# https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys
|
||||
- '--label=org.opencontainers.image.title={{.ProjectName}}'
|
||||
- '--label=org.opencontainers.image.description=CLI utility manage infrastructure as code with helm'
|
||||
- '--label=org.opencontainers.image.source={{.GitURL}}'
|
||||
- '--label=org.opencontainers.image.url={{.GitURL}}'
|
||||
- '--label=org.opencontainers.image.documentation={{.GitURL}}'
|
||||
- '--label=org.opencontainers.image.created={{.Date}}'
|
||||
- '--label=org.opencontainers.image.revision={{.FullCommit}}'
|
||||
- '--label=org.opencontainers.image.version={{.Version}}'
|
||||
- '--platform=linux/amd64'
|
||||
|
||||
- use: buildx
|
||||
goos: linux
|
||||
goarch: arm64
|
||||
dockerfile: Dockerfile
|
||||
image_templates:
|
||||
- '{{ if eq .Prerelease "" }}foomo/sesamy:latest-arm64{{ end }}'
|
||||
- 'foomo/sesamy:{{ .Version }}-arm64'
|
||||
- '{{ if eq .Prerelease "" }}foomo/sesamy:{{ .Major }}-arm64{{ end }}'
|
||||
- '{{ if eq .Prerelease "" }}foomo/sesamy:{{ .Major }}.{{ .Minor }}-arm64{{ end }}'
|
||||
build_flag_templates:
|
||||
- '--pull'
|
||||
# https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys
|
||||
- '--label=org.opencontainers.image.title={{.ProjectName}}'
|
||||
- '--label=org.opencontainers.image.description=CLI utility manage infrastructure as code with helm'
|
||||
- '--label=org.opencontainers.image.source={{.GitURL}}'
|
||||
- '--label=org.opencontainers.image.url={{.GitURL}}'
|
||||
- '--label=org.opencontainers.image.documentation={{.GitURL}}'
|
||||
- '--label=org.opencontainers.image.created={{.Date}}'
|
||||
- '--label=org.opencontainers.image.revision={{.FullCommit}}'
|
||||
- '--label=org.opencontainers.image.version={{.Version}}'
|
||||
- '--platform=linux/arm64'
|
||||
|
||||
docker_manifests:
|
||||
# basic
|
||||
- name_template: 'foomo/sesamy:latest'
|
||||
image_templates:
|
||||
- 'foomo/sesamy:latest-amd64'
|
||||
- 'foomo/sesamy:latest-arm64'
|
||||
skip_push: auto
|
||||
|
||||
- name_template: 'foomo/sesamy:{{ .Version }}'
|
||||
image_templates:
|
||||
- 'foomo/sesamy:{{ .Version }}-amd64'
|
||||
- 'foomo/sesamy:{{ .Version }}-arm64'
|
||||
skip_push: auto
|
||||
|
||||
- name_template: 'foomo/sesamy:{{ .Major }}'
|
||||
image_templates:
|
||||
- 'foomo/sesamy:{{ .Major }}-amd64'
|
||||
- 'foomo/sesamy:{{ .Major }}-arm64'
|
||||
skip_push: auto
|
||||
|
||||
- name_template: 'foomo/sesamy:{{ .Major }}.{{ .Minor }}'
|
||||
image_templates:
|
||||
- 'foomo/sesamy:{{ .Major }}.{{ .Minor }}-amd64'
|
||||
- 'foomo/sesamy:{{ .Major }}.{{ .Minor }}-arm64'
|
||||
skip_push: auto
|
||||
|
||||
12
Dockerfile
Normal file
12
Dockerfile
Normal file
@ -0,0 +1,12 @@
|
||||
FROM alpine:latest
|
||||
|
||||
RUN apk --no-cache add ca-certificates
|
||||
|
||||
RUN adduser -D -u 1001 -g 1001 sesamy
|
||||
|
||||
COPY sesamy /usr/bin/
|
||||
|
||||
USER sesamy
|
||||
WORKDIR /home/sesamy
|
||||
|
||||
ENTRYPOINT ["sesamy"]
|
||||
10
Makefile
10
Makefile
@ -19,11 +19,6 @@ PATH:=bin:$(PATH)
|
||||
|
||||
### Tasks
|
||||
|
||||
.PHONY: brew
|
||||
## Install project binaries
|
||||
brew:
|
||||
@ownbrew install
|
||||
|
||||
.PHONY: doc
|
||||
## Open go docs
|
||||
doc:
|
||||
@ -75,6 +70,11 @@ install.debug:
|
||||
|
||||
### Utils
|
||||
|
||||
.PHONY: brew
|
||||
## Install project binaries
|
||||
brew:
|
||||
@ownbrew install
|
||||
|
||||
.PHONY: help
|
||||
## Show help text
|
||||
help:
|
||||
|
||||
@ -350,6 +350,8 @@ func diff(ctx context.Context, l *slog.Logger, tm *tagmanager.TagManager) (strin
|
||||
return "", err
|
||||
}
|
||||
res = append(res, d...)
|
||||
default:
|
||||
l.Warn("unknown entity type", "entity", entity)
|
||||
}
|
||||
}
|
||||
return strings.Join(res, " ---\n"), nil
|
||||
|
||||
Loading…
Reference in New Issue
Block a user