Browse Source

Backport of add license file into release/1.16.x (#21047)

backport of commit 4a211d0f1d

Co-authored-by: Xinyi Wang <xinyi.wang@hashicorp.com>
pull/21040/head
hc-github-team-consul-core 7 months ago committed by GitHub
parent
commit
57152ab27b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 12
      .github/workflows/build.yml
  2. 10
      Dockerfile

12
.github/workflows/build.yml

@ -141,8 +141,16 @@ jobs:
arch: ${{ matrix.goarch }} arch: ${{ matrix.goarch }}
reproducible: report reproducible: report
instructions: |- instructions: |-
cp LICENSE $TARGET_DIR/LICENSE.txt
go build -ldflags="$GOLDFLAGS" -o "$BIN_PATH" -trimpath -buildvcs=false go build -ldflags="$GOLDFLAGS" -o "$BIN_PATH" -trimpath -buildvcs=false
- 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 - name: Package
if: ${{ matrix.goos == 'linux' }} if: ${{ matrix.goos == 'linux' }}
uses: hashicorp/actions-packaging-linux@v1 uses: hashicorp/actions-packaging-linux@v1
@ -153,7 +161,7 @@ jobs:
version: ${{ needs.set-product-version.outputs.product-version }} version: ${{ needs.set-product-version.outputs.product-version }}
maintainer: "HashiCorp" maintainer: "HashiCorp"
homepage: "https://github.com/hashicorp/consul" homepage: "https://github.com/hashicorp/consul"
license: "MPL-2.0" license: "BSL-1.1"
binary: "dist/${{ env.PKG_NAME }}" binary: "dist/${{ env.PKG_NAME }}"
deb_depends: "openssl" deb_depends: "openssl"
rpm_depends: "openssl" rpm_depends: "openssl"
@ -232,6 +240,7 @@ jobs:
arch: ${{ matrix.goarch }} arch: ${{ matrix.goarch }}
reproducible: report reproducible: report
instructions: |- instructions: |-
cp LICENSE $TARGET_DIR/LICENSE.txt
go build -ldflags="$GOLDFLAGS" -o "$BIN_PATH" -trimpath -buildvcs=false go build -ldflags="$GOLDFLAGS" -o "$BIN_PATH" -trimpath -buildvcs=false
build-darwin: build-darwin:
@ -282,6 +291,7 @@ jobs:
arch: ${{ matrix.goarch }} arch: ${{ matrix.goarch }}
reproducible: report reproducible: report
instructions: |- instructions: |-
cp LICENSE $TARGET_DIR/LICENSE.txt
go build -ldflags="$GOLDFLAGS" -tags netcgo -o "$BIN_PATH" -trimpath -buildvcs=false go build -ldflags="$GOLDFLAGS" -tags netcgo -o "$BIN_PATH" -trimpath -buildvcs=false
build-docker: build-docker:

10
Dockerfile

@ -123,7 +123,7 @@ ENV BIN_NAME=$BIN_NAME
ENV PRODUCT_VERSION=$PRODUCT_VERSION ENV PRODUCT_VERSION=$PRODUCT_VERSION
ARG PRODUCT_REVISION ARG PRODUCT_REVISION
ARG PRODUCT_NAME=$BIN_NAME ENV PRODUCT_NAME=$BIN_NAME
# TARGETOS and TARGETARCH are set automatically when --platform is provided. # TARGETOS and TARGETARCH are set automatically when --platform is provided.
ARG TARGETOS TARGETARCH ARG TARGETOS TARGETARCH
@ -136,8 +136,10 @@ LABEL org.opencontainers.image.authors="Consul Team <consul@hashicorp.com>" \
org.opencontainers.image.vendor="HashiCorp" \ org.opencontainers.image.vendor="HashiCorp" \
org.opencontainers.image.title="consul" \ org.opencontainers.image.title="consul" \
org.opencontainers.image.description="Consul is a datacenter runtime that provides service discovery, configuration, and orchestration." \ org.opencontainers.image.description="Consul is a datacenter runtime that provides service discovery, configuration, and orchestration." \
org.opencontainers.image.licenses="BSL-1.1" \
version=${PRODUCT_VERSION} version=${PRODUCT_VERSION}
COPY LICENSE /usr/share/doc/$PRODUCT_NAME/LICENSE.txt
# Set up certificates and base tools. # Set up certificates and base tools.
# libc6-compat is needed to symlink the shared libraries for ARM builds # libc6-compat is needed to symlink the shared libraries for ARM builds
RUN apk add -v --no-cache \ RUN apk add -v --no-cache \
@ -203,7 +205,6 @@ CMD ["agent", "-dev", "-client", "0.0.0.0"]
# This target is used to build a Consul image for use on OpenShift. # This target is used to build a Consul image for use on OpenShift.
FROM registry.access.redhat.com/ubi9-minimal:9.3 as ubi FROM registry.access.redhat.com/ubi9-minimal:9.3 as ubi
ARG PRODUCT_NAME
ARG PRODUCT_VERSION ARG PRODUCT_VERSION
ARG PRODUCT_REVISION ARG PRODUCT_REVISION
ARG BIN_NAME ARG BIN_NAME
@ -212,8 +213,7 @@ ARG BIN_NAME
# and the version to download. Example: PRODUCT_NAME=consul PRODUCT_VERSION=1.2.3. # and the version to download. Example: PRODUCT_NAME=consul PRODUCT_VERSION=1.2.3.
ENV BIN_NAME=$BIN_NAME ENV BIN_NAME=$BIN_NAME
ENV PRODUCT_VERSION=$PRODUCT_VERSION ENV PRODUCT_VERSION=$PRODUCT_VERSION
ENV PRODUCT_NAME=$BIN_NAME
ARG PRODUCT_NAME=$BIN_NAME
# TARGETOS and TARGETARCH are set automatically when --platform is provided. # TARGETOS and TARGETARCH are set automatically when --platform is provided.
ARG TARGETOS TARGETARCH ARG TARGETOS TARGETARCH
@ -226,8 +226,10 @@ LABEL org.opencontainers.image.authors="Consul Team <consul@hashicorp.com>" \
org.opencontainers.image.vendor="HashiCorp" \ org.opencontainers.image.vendor="HashiCorp" \
org.opencontainers.image.title="consul" \ org.opencontainers.image.title="consul" \
org.opencontainers.image.description="Consul is a datacenter runtime that provides service discovery, configuration, and orchestration." \ org.opencontainers.image.description="Consul is a datacenter runtime that provides service discovery, configuration, and orchestration." \
org.opencontainers.image.licenses="BSL-1.1" \
version=${PRODUCT_VERSION} version=${PRODUCT_VERSION}
COPY LICENSE /usr/share/doc/$PRODUCT_NAME/LICENSE.txt
# Copy license for Red Hat certification. # Copy license for Red Hat certification.
COPY LICENSE /licenses/mozilla.txt COPY LICENSE /licenses/mozilla.txt

Loading…
Cancel
Save