From eabf8befdc3ead6a6bdaff784d2823ff3d76b1a8 Mon Sep 17 00:00:00 2001 From: Evan Fiordeliso Date: Sat, 15 Apr 2023 19:26:02 -0400 Subject: [PATCH] Add docker to goreleaser --- .goreleaser.yaml | 22 +++++++++++++--------- README.md | 23 +---------------------- Taskfile.yml | 10 +--------- 3 files changed, 15 insertions(+), 40 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 631ad32..01ba9b1 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -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 diff --git a/README.md b/README.md index 17d29b2..03d81b2 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/Taskfile.yml b/Taskfile.yml index c3f6dc5..2c83e1e 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -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