Skip to content

Commit

Permalink
NSOF-8035 goreleaser: adapt to our build needs
Browse files Browse the repository at this point in the history
- Remove ocoltel distribution and unneeded archs/platforms from build as
  we only need ocoltel-contrib deb on amd64 in the forseeable future.

- Remove the Makefile dependency that validates .goreleaser.yaml as we
  manually change it - the alternative would have been to mess around
  with the validation tool which isn't worth it for now.

- Remove the "partial" statement from the yaml as partial builds [1] are
  only supported by Goreleaser pro.

[1] https://goreleaser.com/customization/partial/
  • Loading branch information
ebirger committed Sep 21, 2023
1 parent 017bff9 commit a069e82
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 331 deletions.
330 changes: 0 additions & 330 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,60 +1,10 @@
partial:
by: target
project_name: opentelemetry-collector-releases
builds:
- id: otelcol
goos:
- darwin
- linux
- windows
goarch:
- "386"
- amd64
- arm
- arm64
- ppc64le
goarm:
- "7"
ignore:
- goos: darwin
goarch: "386"
- goos: darwin
goarch: arm
- goos: windows
goarch: arm
- goos: windows
goarch: arm64
dir: distributions/otelcol/_build
binary: otelcol
ldflags:
- -s
- -w
flags:
- -trimpath
env:
- CGO_ENABLED=0
- id: otelcol-contrib
goos:
- darwin
- linux
- windows
goarch:
- "386"
- amd64
- arm
- arm64
- ppc64le
goarm:
- "7"
ignore:
- goos: darwin
goarch: "386"
- goos: darwin
goarch: arm
- goos: windows
goarch: arm
- goos: windows
goarch: arm64
dir: distributions/otelcol-contrib/_build
binary: otelcol-contrib
ldflags:
Expand All @@ -65,39 +15,11 @@ builds:
env:
- CGO_ENABLED=0
archives:
- id: otelcol
builds:
- otelcol
name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}'
- id: otelcol-contrib
builds:
- otelcol-contrib
name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}'
nfpms:
- package_name: otelcol
contents:
- src: distributions/otelcol/otelcol.service
dst: /lib/systemd/system/otelcol.service
- src: distributions/otelcol/otelcol.conf
dst: /etc/otelcol/otelcol.conf
type: config|noreplace
- src: configs/otelcol.yaml
dst: /etc/otelcol/config.yaml
type: config
scripts:
preinstall: distributions/otelcol/preinstall.sh
postinstall: distributions/otelcol/postinstall.sh
preremove: distributions/otelcol/preremove.sh
id: otelcol
builds:
- otelcol
formats:
- apk
- deb
- rpm
maintainer: The OpenTelemetry Collector maintainers <[email protected]>
description: OpenTelemetry Collector - otelcol
license: Apache 2.0
- package_name: otelcol-contrib
contents:
- src: distributions/otelcol-contrib/otelcol-contrib.service
Expand All @@ -116,261 +38,9 @@ nfpms:
builds:
- otelcol-contrib
formats:
- apk
- deb
- rpm
maintainer: The OpenTelemetry Collector maintainers <[email protected]>
description: OpenTelemetry Collector - otelcol-contrib
license: Apache 2.0
checksum:
name_template: '{{ .ProjectName }}_checksums.txt'
dockers:
- goos: linux
goarch: "386"
dockerfile: distributions/otelcol/Dockerfile
image_templates:
- otel/opentelemetry-collector:{{ .Version }}-386
- otel/opentelemetry-collector:latest-386
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{ .Version }}-386
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:latest-386
extra_files:
- configs/otelcol.yaml
build_flag_templates:
- --pull
- --platform=linux/386
- --label=org.opencontainers.image.created={{.Date}}
- --label=org.opencontainers.image.name={{.ProjectName}}
- --label=org.opencontainers.image.revision={{.FullCommit}}
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
- goos: linux
goarch: amd64
dockerfile: distributions/otelcol/Dockerfile
image_templates:
- otel/opentelemetry-collector:{{ .Version }}-amd64
- otel/opentelemetry-collector:latest-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{ .Version }}-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:latest-amd64
extra_files:
- configs/otelcol.yaml
build_flag_templates:
- --pull
- --platform=linux/amd64
- --label=org.opencontainers.image.created={{.Date}}
- --label=org.opencontainers.image.name={{.ProjectName}}
- --label=org.opencontainers.image.revision={{.FullCommit}}
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
- goos: linux
goarch: arm
goarm: "7"
dockerfile: distributions/otelcol/Dockerfile
image_templates:
- otel/opentelemetry-collector:{{ .Version }}-armv7
- otel/opentelemetry-collector:latest-armv7
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{ .Version }}-armv7
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:latest-armv7
extra_files:
- configs/otelcol.yaml
build_flag_templates:
- --pull
- --platform=linux/arm/v7
- --label=org.opencontainers.image.created={{.Date}}
- --label=org.opencontainers.image.name={{.ProjectName}}
- --label=org.opencontainers.image.revision={{.FullCommit}}
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
- goos: linux
goarch: arm64
dockerfile: distributions/otelcol/Dockerfile
image_templates:
- otel/opentelemetry-collector:{{ .Version }}-arm64
- otel/opentelemetry-collector:latest-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{ .Version }}-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:latest-arm64
extra_files:
- configs/otelcol.yaml
build_flag_templates:
- --pull
- --platform=linux/arm64
- --label=org.opencontainers.image.created={{.Date}}
- --label=org.opencontainers.image.name={{.ProjectName}}
- --label=org.opencontainers.image.revision={{.FullCommit}}
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
- goos: linux
goarch: ppc64le
dockerfile: distributions/otelcol/Dockerfile
image_templates:
- otel/opentelemetry-collector:{{ .Version }}-ppc64le
- otel/opentelemetry-collector:latest-ppc64le
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{ .Version }}-ppc64le
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:latest-ppc64le
extra_files:
- configs/otelcol.yaml
build_flag_templates:
- --pull
- --platform=linux/ppc64le
- --label=org.opencontainers.image.created={{.Date}}
- --label=org.opencontainers.image.name={{.ProjectName}}
- --label=org.opencontainers.image.revision={{.FullCommit}}
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
- goos: linux
goarch: "386"
dockerfile: distributions/otelcol-contrib/Dockerfile
image_templates:
- otel/opentelemetry-collector-contrib:{{ .Version }}-386
- otel/opentelemetry-collector-contrib:latest-386
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{ .Version }}-386
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest-386
extra_files:
- configs/otelcol-contrib.yaml
build_flag_templates:
- --pull
- --platform=linux/386
- --label=org.opencontainers.image.created={{.Date}}
- --label=org.opencontainers.image.name={{.ProjectName}}
- --label=org.opencontainers.image.revision={{.FullCommit}}
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
- goos: linux
goarch: amd64
dockerfile: distributions/otelcol-contrib/Dockerfile
image_templates:
- otel/opentelemetry-collector-contrib:{{ .Version }}-amd64
- otel/opentelemetry-collector-contrib:latest-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{ .Version }}-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest-amd64
extra_files:
- configs/otelcol-contrib.yaml
build_flag_templates:
- --pull
- --platform=linux/amd64
- --label=org.opencontainers.image.created={{.Date}}
- --label=org.opencontainers.image.name={{.ProjectName}}
- --label=org.opencontainers.image.revision={{.FullCommit}}
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
- goos: linux
goarch: arm
goarm: "7"
dockerfile: distributions/otelcol-contrib/Dockerfile
image_templates:
- otel/opentelemetry-collector-contrib:{{ .Version }}-armv7
- otel/opentelemetry-collector-contrib:latest-armv7
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{ .Version }}-armv7
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest-armv7
extra_files:
- configs/otelcol-contrib.yaml
build_flag_templates:
- --pull
- --platform=linux/arm/v7
- --label=org.opencontainers.image.created={{.Date}}
- --label=org.opencontainers.image.name={{.ProjectName}}
- --label=org.opencontainers.image.revision={{.FullCommit}}
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
- goos: linux
goarch: arm64
dockerfile: distributions/otelcol-contrib/Dockerfile
image_templates:
- otel/opentelemetry-collector-contrib:{{ .Version }}-arm64
- otel/opentelemetry-collector-contrib:latest-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{ .Version }}-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest-arm64
extra_files:
- configs/otelcol-contrib.yaml
build_flag_templates:
- --pull
- --platform=linux/arm64
- --label=org.opencontainers.image.created={{.Date}}
- --label=org.opencontainers.image.name={{.ProjectName}}
- --label=org.opencontainers.image.revision={{.FullCommit}}
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
- goos: linux
goarch: ppc64le
dockerfile: distributions/otelcol-contrib/Dockerfile
image_templates:
- otel/opentelemetry-collector-contrib:{{ .Version }}-ppc64le
- otel/opentelemetry-collector-contrib:latest-ppc64le
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{ .Version }}-ppc64le
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest-ppc64le
extra_files:
- configs/otelcol-contrib.yaml
build_flag_templates:
- --pull
- --platform=linux/ppc64le
- --label=org.opencontainers.image.created={{.Date}}
- --label=org.opencontainers.image.name={{.ProjectName}}
- --label=org.opencontainers.image.revision={{.FullCommit}}
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
docker_manifests:
- name_template: otel/opentelemetry-collector:{{ .Version }}
image_templates:
- otel/opentelemetry-collector:{{ .Version }}-386
- otel/opentelemetry-collector:{{ .Version }}-amd64
- otel/opentelemetry-collector:{{ .Version }}-armv7
- otel/opentelemetry-collector:{{ .Version }}-arm64
- otel/opentelemetry-collector:{{ .Version }}-ppc64le
- name_template: otel/opentelemetry-collector:latest
image_templates:
- otel/opentelemetry-collector:latest-386
- otel/opentelemetry-collector:latest-amd64
- otel/opentelemetry-collector:latest-armv7
- otel/opentelemetry-collector:latest-arm64
- otel/opentelemetry-collector:latest-ppc64le
- name_template: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{ .Version }}
image_templates:
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{ .Version }}-386
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{ .Version }}-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{ .Version }}-armv7
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{ .Version }}-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:{{ .Version }}-ppc64le
- name_template: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:latest
image_templates:
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:latest-386
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:latest-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:latest-armv7
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:latest-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:latest-ppc64le
- name_template: otel/opentelemetry-collector-contrib:{{ .Version }}
image_templates:
- otel/opentelemetry-collector-contrib:{{ .Version }}-386
- otel/opentelemetry-collector-contrib:{{ .Version }}-amd64
- otel/opentelemetry-collector-contrib:{{ .Version }}-armv7
- otel/opentelemetry-collector-contrib:{{ .Version }}-arm64
- otel/opentelemetry-collector-contrib:{{ .Version }}-ppc64le
- name_template: otel/opentelemetry-collector-contrib:latest
image_templates:
- otel/opentelemetry-collector-contrib:latest-386
- otel/opentelemetry-collector-contrib:latest-amd64
- otel/opentelemetry-collector-contrib:latest-armv7
- otel/opentelemetry-collector-contrib:latest-arm64
- otel/opentelemetry-collector-contrib:latest-ppc64le
- name_template: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{ .Version }}
image_templates:
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{ .Version }}-386
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{ .Version }}-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{ .Version }}-armv7
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{ .Version }}-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{ .Version }}-ppc64le
- name_template: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest
image_templates:
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest-386
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest-armv7
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest-ppc64le
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ OTELCOL_BUILDER ?= ${OTELCOL_BUILDER_DIR}/ocb
DISTRIBUTIONS ?= "otelcol,otelcol-contrib"

ci: check build
check: ensure-goreleaser-up-to-date
check:

build: go ocb
@./scripts/build.sh -d "${DISTRIBUTIONS}" -b ${OTELCOL_BUILDER} -g ${GO}
Expand Down

0 comments on commit a069e82

Please sign in to comment.