Add docker to goreleaser

This commit is contained in:
Evan Fiordeliso 2023-04-15 19:26:02 -04:00
parent bc32a09a5d
commit eabf8befdc
3 changed files with 15 additions and 40 deletions

View File

@ -1,3 +1,9 @@
project_name: ytdl-web
env:
- BASE_PKG=go.fifitido.net/ytdl-web
gitea_urls:
api: https://git.fifitido.net/api/v1
download: https://git.fifitido.net
before:
hooks:
- go mod tidy
@ -9,11 +15,13 @@ builds:
- windows
- darwin
ldflags:
- -X go.fifitido.net/ytdl-web/version.Version={{.Version}}
- -X go.fifitido.net/ytdl-web/version.Build={{.Commit}}
- -X go.fifitido.net/ytdl-web/version.BuildDate={{.Date}}
- -X go.fifitido.net/ytdl-web/version.BuiltBy=goreleaser
- -X {{ .Env.BASE_PKG }}/version.Version={{.Version}}
- -X {{ .Env.BASE_PKG }}/version.Build={{.Commit}}
- -X {{ .Env.BASE_PKG }}/version.BuildDate={{.Date}}
- -X {{ .Env.BASE_PKG }}/version.BuiltBy=goreleaser
dockers:
- image_templates:
- git.fifitido.net/apps/{{.ProjectName}}
archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of uname.
@ -38,10 +46,6 @@ changelog:
exclude:
- "^docs:"
- "^test:"
gitea_urls:
api: https://git.fifitido.net/api/v1
download: https://git.fifitido.net
# The lines beneath this are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json

View File

@ -54,27 +54,6 @@ Steps:
task release
```
## Publishing Docker Image
Prerequisites:
- [docker](https://docs.docker.com/engine/install/)
- [task cli](https://taskfile.dev/installation/)
Steps:
1. Login to the container registry
```sh
docker login git.fifitido.net
```
2. Publish the container image
```sh
task docker:publish
```
## Publishing Chart
Prerequisites:
@ -94,5 +73,5 @@ helm repo add --username {username} --password {password} gitea-apps https://git
2. Publish the chart
```sh
task chart:publish
task publish-chart
```

View File

@ -25,12 +25,4 @@ tasks:
-o {{.OUT}} .
dev: air
release: goreleaser release
chart:publish: helm cm-push charts/ytdl-web/ gitea-apps
docker:build: docker build -t {{.DOCKER_IMAGE}}:{{.DOCKER_IMAGE_TAG}} .
docker:publish:
deps:
- docker:build
cmds:
- docker push {{.DOCKER_IMAGE}}:{{.DOCKER_IMAGE_TAG}}
publish-chart: helm cm-push charts/ytdl-web/ gitea-apps