add LICENSE to release artifacts (#20345)

* add LICENSE(.txt) to zip that goes on releases.hashicorp.com
* add LICENSE(.txt) to linux packages and docker image
* add some more docker labels (including license)
This commit is contained in:
Daniel Bennett
2024-04-12 10:57:15 -05:00
committed by GitHub
parent d40e23f939
commit bd802e43d0
3 changed files with 27 additions and 4 deletions

View File

@@ -198,6 +198,13 @@ jobs:
name: ${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip
path: ${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip
- name: Copy license file
env:
LICENSE_DIR: ".release/linux/package/usr/share/doc/${{ env.PKG_NAME }}"
run: |
mkdir -p "$LICENSE_DIR"
cp LICENSE "$LICENSE_DIR/LICENSE.txt"
- name: Package
uses: hashicorp/actions-packaging-linux@v1
with:

View File

@@ -11,9 +11,22 @@ ARG PRODUCT_REVISION
# TARGETARCH and TARGETOS are set automatically when --platform is provided.
ARG TARGETOS TARGETARCH
LABEL maintainer="Nomad Team <nomad@hashicorp.com>"
LABEL version=${PRODUCT_VERSION}
LABEL revision=${PRODUCT_REVISION}
LABEL maintainer="Nomad Team <nomad@hashicorp.com>" \
version=${PRODUCT_VERSION} \
revision=${PRODUCT_REVISION} \
org.opencontainers.image.title="nomad" \
org.opencontainers.image.description="Nomad is a lightweight and flexible orchestrator for heterogenous workloads" \
org.opencontainers.image.authors="Nomad Team <nomad@hashicorp.com>" \
org.opencontainers.image.url="https://www.nomadproject.io/" \
org.opencontainers.image.documentation="https://www.nomadproject.io/docs" \
org.opencontainers.image.source="https://github.com/hashicorp/nomad" \
org.opencontainers.image.version=${PRODUCT_VERSION} \
org.opencontainers.image.revision=${PRODUCT_REVISION} \
org.opencontainers.image.vendor="HashiCorp" \
org.opencontainers.image.licenses="BUSL-1.1"
RUN mkdir -p /usr/share/doc/nomad
COPY LICENSE /usr/share/doc/nomad/LICENSE.txt
COPY dist/$TARGETOS/$TARGETARCH/nomad /bin/
COPY ./scripts/docker-entrypoint.sh /

View File

@@ -114,7 +114,10 @@ pkg/windows_%/nomad: GO_TAGS += timetzdata
# Define package targets for each of the build targets we actually have on this system
define makePackageTarget
pkg/$(1).zip: pkg/$(1)/nomad
pkg/$(1)/LICENSE.txt:
@cp LICENSE pkg/$(1)/LICENSE.txt
pkg/$(1).zip: pkg/$(1)/nomad pkg/$(1)/LICENSE.txt
@echo "==> Packaging for $(1)..."
@zip -j pkg/$(1).zip pkg/$(1)/*