mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-07-13 04:57:11 +00:00
96f9f4a36c
Problem: - GoReleaser Pro features (use: buildx, build_flag_templates) not available in free version - CI/CD failing with "field not found in type config.DockerV2" errors Solution: - Split each Docker image into separate amd64 and arm64 builds - Use goarch field to specify architecture - Use build_flags instead of build_flag_templates - Add docker_manifests section to combine arch-specific images into multi-arch manifests Changes: - Each service now has two Docker image definitions (amd64 and arm64) - Images tagged with architecture suffix (e.g., v1.0.0-amd64, v1.0.0-arm64) - Docker manifests combine them into unified tags (e.g., v1.0.0, latest) - Users can pull multi-arch images normally, Docker will select correct arch Result: - Works with free GoReleaser version - Maintains multi-architecture support - Multi-stage Dockerfiles compile for each architecture natively
371 lines
13 KiB
YAML
371 lines
13 KiB
YAML
version: 2
|
|
|
|
# Project metadata
|
|
project_name: gohoarder
|
|
|
|
# Pre-release hooks
|
|
before:
|
|
hooks:
|
|
- go mod tidy
|
|
# Generate semantic version if not provided via git tag
|
|
# This script can be used by CI/CD to inject custom versions
|
|
# Usage: export GORELEASER_CURRENT_TAG=$(./script/generate-version.sh)
|
|
# - ./script/generate-version.sh
|
|
|
|
# Build configuration
|
|
# Note: Binaries are built inside Docker containers (multi-stage builds)
|
|
# to avoid CGO cross-compilation issues. No standalone builds here.
|
|
builds:
|
|
- id: gohoarder
|
|
skip: true
|
|
- id: migrate
|
|
skip: true
|
|
|
|
# Archives for releases
|
|
archives:
|
|
- id: default
|
|
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 }}
|
|
formats:
|
|
- tar.gz
|
|
- zip
|
|
format_overrides:
|
|
- goos: windows
|
|
formats:
|
|
- zip
|
|
files:
|
|
- README.md
|
|
- LICENSE
|
|
- config.yaml.example
|
|
|
|
# Checksum
|
|
checksum:
|
|
name_template: 'checksums.txt'
|
|
algorithm: sha256
|
|
|
|
# Snapshot configuration
|
|
snapshot:
|
|
version_template: "{{ incpatch .Version }}-next"
|
|
|
|
# Changelog
|
|
changelog:
|
|
sort: asc
|
|
filters:
|
|
exclude:
|
|
- '^docs:'
|
|
- '^test:'
|
|
- '^ci:'
|
|
- '^chore:'
|
|
- '^Merge'
|
|
- '^WIP'
|
|
- '^Update go.mod'
|
|
- 'README'
|
|
|
|
# GitHub release configuration
|
|
release:
|
|
github:
|
|
owner: lukaszraczylo
|
|
name: gohoarder
|
|
name_template: "version {{.Version}}"
|
|
draft: false
|
|
prerelease: auto
|
|
|
|
# Docker images (v2 - modern syntax)
|
|
dockers_v2:
|
|
# 1. Application Engine - Main GoHoarder server
|
|
- id: gohoarder-server
|
|
images:
|
|
- ghcr.io/lukaszraczylo/gohoarder-server
|
|
goarch: amd64
|
|
build_flags:
|
|
- "--build-arg=VERSION={{ .Version }}"
|
|
- "--build-arg=GIT_COMMIT={{ .ShortCommit }}"
|
|
- "--build-arg=BUILD_TIME={{ .Date }}"
|
|
- "--build-arg=TARGETOS=linux"
|
|
- "--build-arg=TARGETARCH=amd64"
|
|
tags:
|
|
- "{{ .Version }}-amd64"
|
|
- latest-amd64
|
|
dockerfile: Dockerfile.server
|
|
labels:
|
|
org.opencontainers.image.title: GoHoarder Server
|
|
org.opencontainers.image.description: Universal package cache proxy server
|
|
org.opencontainers.image.url: https://github.com/lukaszraczylo/gohoarder
|
|
org.opencontainers.image.source: https://github.com/lukaszraczylo/gohoarder
|
|
org.opencontainers.image.version: "{{ .Version }}"
|
|
org.opencontainers.image.created: "{{ .Date }}"
|
|
org.opencontainers.image.revision: "{{ .FullCommit }}"
|
|
extra_files:
|
|
- config.yaml.example
|
|
|
|
- id: gohoarder-server-arm64
|
|
images:
|
|
- ghcr.io/lukaszraczylo/gohoarder-server
|
|
goarch: arm64
|
|
build_flags:
|
|
- "--build-arg=VERSION={{ .Version }}"
|
|
- "--build-arg=GIT_COMMIT={{ .ShortCommit }}"
|
|
- "--build-arg=BUILD_TIME={{ .Date }}"
|
|
- "--build-arg=TARGETOS=linux"
|
|
- "--build-arg=TARGETARCH=arm64"
|
|
tags:
|
|
- "{{ .Version }}-arm64"
|
|
- latest-arm64
|
|
dockerfile: Dockerfile.server
|
|
labels:
|
|
org.opencontainers.image.title: GoHoarder Server
|
|
org.opencontainers.image.description: Universal package cache proxy server
|
|
org.opencontainers.image.url: https://github.com/lukaszraczylo/gohoarder
|
|
org.opencontainers.image.source: https://github.com/lukaszraczylo/gohoarder
|
|
org.opencontainers.image.version: "{{ .Version }}"
|
|
org.opencontainers.image.created: "{{ .Date }}"
|
|
org.opencontainers.image.revision: "{{ .FullCommit }}"
|
|
extra_files:
|
|
- config.yaml.example
|
|
|
|
# 2. Website - Frontend Dashboard
|
|
- id: gohoarder-frontend
|
|
images:
|
|
- ghcr.io/lukaszraczylo/gohoarder-frontend
|
|
goarch: amd64
|
|
tags:
|
|
- "{{ .Version }}-amd64"
|
|
- latest-amd64
|
|
dockerfile: Dockerfile.frontend
|
|
labels:
|
|
org.opencontainers.image.title: GoHoarder Frontend
|
|
org.opencontainers.image.description: GoHoarder web dashboard
|
|
org.opencontainers.image.url: https://github.com/lukaszraczylo/gohoarder
|
|
org.opencontainers.image.source: https://github.com/lukaszraczylo/gohoarder
|
|
org.opencontainers.image.version: "{{ .Version }}"
|
|
org.opencontainers.image.created: "{{ .Date }}"
|
|
org.opencontainers.image.revision: "{{ .FullCommit }}"
|
|
extra_files:
|
|
- frontend
|
|
|
|
- id: gohoarder-frontend-arm64
|
|
images:
|
|
- ghcr.io/lukaszraczylo/gohoarder-frontend
|
|
goarch: arm64
|
|
tags:
|
|
- "{{ .Version }}-arm64"
|
|
- latest-arm64
|
|
dockerfile: Dockerfile.frontend
|
|
labels:
|
|
org.opencontainers.image.title: GoHoarder Frontend
|
|
org.opencontainers.image.description: GoHoarder web dashboard
|
|
org.opencontainers.image.url: https://github.com/lukaszraczylo/gohoarder
|
|
org.opencontainers.image.source: https://github.com/lukaszraczylo/gohoarder
|
|
org.opencontainers.image.version: "{{ .Version }}"
|
|
org.opencontainers.image.created: "{{ .Date }}"
|
|
org.opencontainers.image.revision: "{{ .FullCommit }}"
|
|
extra_files:
|
|
- frontend
|
|
|
|
# 3. Scanning Engine - Background scanner worker
|
|
- id: gohoarder-scanner
|
|
images:
|
|
- ghcr.io/lukaszraczylo/gohoarder-scanner
|
|
goarch: amd64
|
|
build_flags:
|
|
- "--build-arg=VERSION={{ .Version }}"
|
|
- "--build-arg=GIT_COMMIT={{ .ShortCommit }}"
|
|
- "--build-arg=BUILD_TIME={{ .Date }}"
|
|
- "--build-arg=TARGETOS=linux"
|
|
- "--build-arg=TARGETARCH=amd64"
|
|
tags:
|
|
- "{{ .Version }}-amd64"
|
|
- latest-amd64
|
|
dockerfile: Dockerfile.scanner
|
|
labels:
|
|
org.opencontainers.image.title: GoHoarder Scanner
|
|
org.opencontainers.image.description: GoHoarder vulnerability scanning engine
|
|
org.opencontainers.image.url: https://github.com/lukaszraczylo/gohoarder
|
|
org.opencontainers.image.source: https://github.com/lukaszraczylo/gohoarder
|
|
org.opencontainers.image.version: "{{ .Version }}"
|
|
org.opencontainers.image.created: "{{ .Date }}"
|
|
org.opencontainers.image.revision: "{{ .FullCommit }}"
|
|
extra_files:
|
|
- config.yaml.example
|
|
|
|
- id: gohoarder-scanner-arm64
|
|
images:
|
|
- ghcr.io/lukaszraczylo/gohoarder-scanner
|
|
goarch: arm64
|
|
build_flags:
|
|
- "--build-arg=VERSION={{ .Version }}"
|
|
- "--build-arg=GIT_COMMIT={{ .ShortCommit }}"
|
|
- "--build-arg=BUILD_TIME={{ .Date }}"
|
|
- "--build-arg=TARGETOS=linux"
|
|
- "--build-arg=TARGETARCH=arm64"
|
|
tags:
|
|
- "{{ .Version }}-arm64"
|
|
- latest-arm64
|
|
dockerfile: Dockerfile.scanner
|
|
labels:
|
|
org.opencontainers.image.title: GoHoarder Scanner
|
|
org.opencontainers.image.description: GoHoarder vulnerability scanning engine
|
|
org.opencontainers.image.url: https://github.com/lukaszraczylo/gohoarder
|
|
org.opencontainers.image.source: https://github.com/lukaszraczylo/gohoarder
|
|
org.opencontainers.image.version: "{{ .Version }}"
|
|
org.opencontainers.image.created: "{{ .Date }}"
|
|
org.opencontainers.image.revision: "{{ .FullCommit }}"
|
|
extra_files:
|
|
- config.yaml.example
|
|
|
|
# 4. Gateway - Nginx reverse proxy for unified deployment
|
|
- id: gohoarder-gateway
|
|
images:
|
|
- ghcr.io/lukaszraczylo/gohoarder-gateway
|
|
goarch: amd64
|
|
tags:
|
|
- "{{ .Version }}-amd64"
|
|
- latest-amd64
|
|
dockerfile: Dockerfile.gateway
|
|
labels:
|
|
org.opencontainers.image.title: GoHoarder Gateway
|
|
org.opencontainers.image.description: Nginx reverse proxy for unified GoHoarder deployment
|
|
org.opencontainers.image.url: https://github.com/lukaszraczylo/gohoarder
|
|
org.opencontainers.image.source: https://github.com/lukaszraczylo/gohoarder
|
|
org.opencontainers.image.version: "{{ .Version }}"
|
|
org.opencontainers.image.created: "{{ .Date }}"
|
|
org.opencontainers.image.revision: "{{ .FullCommit }}"
|
|
|
|
- id: gohoarder-gateway-arm64
|
|
images:
|
|
- ghcr.io/lukaszraczylo/gohoarder-gateway
|
|
goarch: arm64
|
|
tags:
|
|
- "{{ .Version }}-arm64"
|
|
- latest-arm64
|
|
dockerfile: Dockerfile.gateway
|
|
labels:
|
|
org.opencontainers.image.title: GoHoarder Gateway
|
|
org.opencontainers.image.description: Nginx reverse proxy for unified GoHoarder deployment
|
|
org.opencontainers.image.url: https://github.com/lukaszraczylo/gohoarder
|
|
org.opencontainers.image.source: https://github.com/lukaszraczylo/gohoarder
|
|
org.opencontainers.image.version: "{{ .Version }}"
|
|
org.opencontainers.image.created: "{{ .Date }}"
|
|
org.opencontainers.image.revision: "{{ .FullCommit }}"
|
|
|
|
# 5. Migration Engine - Database migration tool
|
|
- id: gohoarder-migrate
|
|
images:
|
|
- ghcr.io/lukaszraczylo/gohoarder-migrate
|
|
goarch: amd64
|
|
build_flags:
|
|
- "--build-arg=VERSION={{ .Version }}"
|
|
- "--build-arg=GIT_COMMIT={{ .ShortCommit }}"
|
|
- "--build-arg=BUILD_TIME={{ .Date }}"
|
|
- "--build-arg=TARGETOS=linux"
|
|
- "--build-arg=TARGETARCH=amd64"
|
|
tags:
|
|
- "{{ .Version }}-amd64"
|
|
- latest-amd64
|
|
dockerfile: Dockerfile.migrate
|
|
labels:
|
|
org.opencontainers.image.title: GoHoarder Migrate
|
|
org.opencontainers.image.description: Database migration tool for GoHoarder V2 schema
|
|
org.opencontainers.image.url: https://github.com/lukaszraczylo/gohoarder
|
|
org.opencontainers.image.source: https://github.com/lukaszraczylo/gohoarder
|
|
org.opencontainers.image.version: "{{ .Version }}"
|
|
org.opencontainers.image.created: "{{ .Date }}"
|
|
org.opencontainers.image.revision: "{{ .FullCommit }}"
|
|
|
|
- id: gohoarder-migrate-arm64
|
|
images:
|
|
- ghcr.io/lukaszraczylo/gohoarder-migrate
|
|
goarch: arm64
|
|
build_flags:
|
|
- "--build-arg=VERSION={{ .Version }}"
|
|
- "--build-arg=GIT_COMMIT={{ .ShortCommit }}"
|
|
- "--build-arg=BUILD_TIME={{ .Date }}"
|
|
- "--build-arg=TARGETOS=linux"
|
|
- "--build-arg=TARGETARCH=arm64"
|
|
tags:
|
|
- "{{ .Version }}-arm64"
|
|
- latest-arm64
|
|
dockerfile: Dockerfile.migrate
|
|
labels:
|
|
org.opencontainers.image.title: GoHoarder Migrate
|
|
org.opencontainers.image.description: Database migration tool for GoHoarder V2 schema
|
|
org.opencontainers.image.url: https://github.com/lukaszraczylo/gohoarder
|
|
org.opencontainers.image.source: https://github.com/lukaszraczylo/gohoarder
|
|
org.opencontainers.image.version: "{{ .Version }}"
|
|
org.opencontainers.image.created: "{{ .Date }}"
|
|
org.opencontainers.image.revision: "{{ .FullCommit }}"
|
|
|
|
# Artifact signing with cosign
|
|
signs:
|
|
- cmd: cosign
|
|
signature: "${artifact}.sigstore.json"
|
|
args:
|
|
- sign-blob
|
|
- "--bundle=${signature}"
|
|
- "${artifact}"
|
|
- "--yes"
|
|
artifacts: checksum
|
|
output: true
|
|
|
|
# Docker image signing with cosign
|
|
docker_signs:
|
|
- cmd: cosign
|
|
artifacts: manifests
|
|
output: true
|
|
args:
|
|
- sign
|
|
- "${artifact}@${digest}"
|
|
- "--yes"
|
|
|
|
# Docker manifests for multi-arch support
|
|
docker_manifests:
|
|
- name_template: ghcr.io/lukaszraczylo/gohoarder-server:{{ .Version }}
|
|
image_templates:
|
|
- ghcr.io/lukaszraczylo/gohoarder-server:{{ .Version }}-amd64
|
|
- ghcr.io/lukaszraczylo/gohoarder-server:{{ .Version }}-arm64
|
|
- name_template: ghcr.io/lukaszraczylo/gohoarder-server:latest
|
|
image_templates:
|
|
- ghcr.io/lukaszraczylo/gohoarder-server:latest-amd64
|
|
- ghcr.io/lukaszraczylo/gohoarder-server:latest-arm64
|
|
|
|
- name_template: ghcr.io/lukaszraczylo/gohoarder-frontend:{{ .Version }}
|
|
image_templates:
|
|
- ghcr.io/lukaszraczylo/gohoarder-frontend:{{ .Version }}-amd64
|
|
- ghcr.io/lukaszraczylo/gohoarder-frontend:{{ .Version }}-arm64
|
|
- name_template: ghcr.io/lukaszraczylo/gohoarder-frontend:latest
|
|
image_templates:
|
|
- ghcr.io/lukaszraczylo/gohoarder-frontend:latest-amd64
|
|
- ghcr.io/lukaszraczylo/gohoarder-frontend:latest-arm64
|
|
|
|
- name_template: ghcr.io/lukaszraczylo/gohoarder-scanner:{{ .Version }}
|
|
image_templates:
|
|
- ghcr.io/lukaszraczylo/gohoarder-scanner:{{ .Version }}-amd64
|
|
- ghcr.io/lukaszraczylo/gohoarder-scanner:{{ .Version }}-arm64
|
|
- name_template: ghcr.io/lukaszraczylo/gohoarder-scanner:latest
|
|
image_templates:
|
|
- ghcr.io/lukaszraczylo/gohoarder-scanner:latest-amd64
|
|
- ghcr.io/lukaszraczylo/gohoarder-scanner:latest-arm64
|
|
|
|
- name_template: ghcr.io/lukaszraczylo/gohoarder-gateway:{{ .Version }}
|
|
image_templates:
|
|
- ghcr.io/lukaszraczylo/gohoarder-gateway:{{ .Version }}-amd64
|
|
- ghcr.io/lukaszraczylo/gohoarder-gateway:{{ .Version }}-arm64
|
|
- name_template: ghcr.io/lukaszraczylo/gohoarder-gateway:latest
|
|
image_templates:
|
|
- ghcr.io/lukaszraczylo/gohoarder-gateway:latest-amd64
|
|
- ghcr.io/lukaszraczylo/gohoarder-gateway:latest-arm64
|
|
|
|
- name_template: ghcr.io/lukaszraczylo/gohoarder-migrate:{{ .Version }}
|
|
image_templates:
|
|
- ghcr.io/lukaszraczylo/gohoarder-migrate:{{ .Version }}-amd64
|
|
- ghcr.io/lukaszraczylo/gohoarder-migrate:{{ .Version }}-arm64
|
|
- name_template: ghcr.io/lukaszraczylo/gohoarder-migrate:latest
|
|
image_templates:
|
|
- ghcr.io/lukaszraczylo/gohoarder-migrate:latest-amd64
|
|
- ghcr.io/lukaszraczylo/gohoarder-migrate:latest-arm64
|