Change "COMPANY_NAME" to "PACKAGER_NAME"

The COMPANY_NAME currently sets the "CompanyName" field in the metadata
of Windows binaries. Our intent of this field is this field to contain
information about the company/party that produced the binary.

Also from [FileVersionInfo.CompanyName][FileVersionInfo.CompanyName]:

> Gets the name of the company that produced the file

Based on the above, "PACKAGER_NAME" is a bit more generic, and clearer
on intent, and we may at some point re-use this same information to
propagate equivalent fields on other platforms (rpms, debs)

[FileVersionInfo.CompanyName]: https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.fileversioninfo.companyname

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-03-27 10:09:50 +02:00
parent dd7397342a
commit 4cd2d9ddd2
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
5 changed files with 11 additions and 11 deletions

View File

@ -52,8 +52,8 @@ ARG GO_STRIP
ARG CGO_ENABLED ARG CGO_ENABLED
# VERSION sets the version for the produced binary # VERSION sets the version for the produced binary
ARG VERSION ARG VERSION
# COMPANY_NAME sets the company that produced the windows binary # PACKAGER_NAME sets the company that produced the windows binary
ARG COMPANY_NAME ARG PACKAGER_NAME
COPY --from=goversioninfo /out/goversioninfo /usr/bin/goversioninfo COPY --from=goversioninfo /out/goversioninfo /usr/bin/goversioninfo
RUN --mount=type=bind,target=.,ro \ RUN --mount=type=bind,target=.,ro \
--mount=type=cache,target=/root/.cache \ --mount=type=cache,target=/root/.cache \

View File

@ -3,7 +3,7 @@
# #
# Sets the name of the company that produced the windows binary. # Sets the name of the company that produced the windows binary.
COMPANY_NAME ?= PACKAGER_NAME ?=
all: binary all: binary

View File

@ -15,7 +15,7 @@ variable "IMAGE_NAME" {
} }
# Sets the name of the company that produced the windows binary. # Sets the name of the company that produced the windows binary.
variable "COMPANY_NAME" { variable "PACKAGER_NAME" {
default = "" default = ""
} }
@ -38,7 +38,7 @@ target "binary" {
args = { args = {
BASE_VARIANT = USE_GLIBC != "" ? "buster" : "alpine" BASE_VARIANT = USE_GLIBC != "" ? "buster" : "alpine"
VERSION = VERSION VERSION = VERSION
COMPANY_NAME = COMPANY_NAME PACKAGER_NAME = PACKAGER_NAME
GO_STRIP = STRIP_TARGET GO_STRIP = STRIP_TARGET
} }
} }

View File

@ -10,7 +10,7 @@ DOCKER_CLI_CONTAINER_NAME ?=
DOCKER_CLI_GO_BUILD_CACHE ?= y DOCKER_CLI_GO_BUILD_CACHE ?= y
# Sets the name of the company that produced the windows binary. # Sets the name of the company that produced the windows binary.
COMPANY_NAME ?= PACKAGER_NAME ?=
DEV_DOCKER_IMAGE_NAME = docker-cli-dev$(IMAGE_TAG) DEV_DOCKER_IMAGE_NAME = docker-cli-dev$(IMAGE_TAG)
E2E_IMAGE_NAME = docker-cli-e2e E2E_IMAGE_NAME = docker-cli-e2e
@ -36,7 +36,7 @@ DOCKER_RUN := docker run --rm $(ENVVARS) $(DOCKER_CLI_MOUNTS) $(DOCKER_RUN_NAME_
.PHONY: binary .PHONY: binary
binary: binary:
COMPANY_NAME=$(COMPANY_NAME) docker buildx bake binary PACKAGER_NAME=$(PACKAGER_NAME) docker buildx bake binary
build: binary ## alias for binary build: binary ## alias for binary
@ -53,11 +53,11 @@ clean: build_docker_image ## clean build artifacts
.PHONY: cross .PHONY: cross
cross: cross:
COMPANY_NAME=$(COMPANY_NAME) docker buildx bake cross PACKAGER_NAME=$(PACKAGER_NAME) docker buildx bake cross
.PHONY: dynbinary .PHONY: dynbinary
dynbinary: ## build dynamically linked binary dynbinary: ## build dynamically linked binary
USE_GLIBC=1 COMPANY_NAME=$(COMPANY_NAME) docker buildx bake dynbinary USE_GLIBC=1 PACKAGER_NAME=$(PACKAGER_NAME) docker buildx bake dynbinary
.PHONY: dev .PHONY: dev
dev: build_docker_image ## start a build container in interactive mode for in-container development dev: build_docker_image ## start a build container in interactive mode for in-container development

View File

@ -1,7 +1,7 @@
#!/usr/bin/env sh #!/usr/bin/env sh
set -eu set -eu
: "${COMPANY_NAME=}" : "${PACKAGER_NAME=}"
. ./scripts/build/.variables . ./scripts/build/.variables
@ -31,7 +31,7 @@ cat > ./cli/winresources/versioninfo.json <<EOL
"StringFileInfo": "StringFileInfo":
{ {
"Comments": "", "Comments": "",
"CompanyName": "${COMPANY_NAME}", "CompanyName": "${PACKAGER_NAME}",
"FileDescription": "Docker Client", "FileDescription": "Docker Client",
"FileVersion": "${VERSION}", "FileVersion": "${VERSION}",
"InternalName": "", "InternalName": "",