Skip to content

Commit

Permalink
Merge pull request #1090 from hashicorp/xw/NET-9552-add-license
Browse files Browse the repository at this point in the history
add license file
  • Loading branch information
sarahethompson authored Jun 6, 2024
2 parents 9a9f205 + cf46c8e commit df5f557
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ jobs:
LD_FLAGS: ${{ needs.set-ld-flags.outputs.ldflags }}
run: |
mkdir dist out
cp LICENSE dist/LICENSE.txt
go build -o dist/ \
-ldflags "${{ env.LD_FLAGS }}" \
-tags "${{ env.GO_TAGS }}"
Expand All @@ -107,6 +108,13 @@ jobs:
name: ${{ env.PKG_NAME }}_${{ needs.get-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip
path: out/${{ 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
if: ${{ matrix.goos == 'linux' }}
uses: hashicorp/actions-packaging-linux@v1
Expand All @@ -121,6 +129,7 @@ jobs:
binary: "dist/${{ env.PKG_NAME }}"
deb_depends: "openssl"
rpm_depends: "openssl"
config_dir: ".release/linux/package"

- name: Set Package Names
if: ${{ matrix.goos == 'linux' }}
Expand Down Expand Up @@ -169,6 +178,7 @@ jobs:
GO_TAGS: "${{ env.GO_TAGS }} netcgo"
run: |
mkdir dist out
cp LICENSE dist/LICENSE.txt
go build -o dist/ \
-ldflags "${{ env.LD_FLAGS }}" \
-tags "${{ env.GO_TAGS }}"
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ ARG PRODUCT_VERSION

LABEL maintainer="Consul Team <[email protected]>"
LABEL version=$PRODUCT_VERSION
LABEL licenses="MPL-2.0"

# Set ARGs as ENV so that they can be used in ENTRYPOINT/CMD
ENV NAME=$NAME
ENV VERSION=$PRODUCT_VERSION
ENV PRODUCT_NAME=$NAME

# TARGETARCH and TARGETOS are set automatically when --platform is provided.
ARG TARGETOS TARGETARCH
Expand All @@ -24,6 +26,7 @@ RUN apk add --no-cache dumb-init git bash openssh
RUN addgroup ${NAME} && adduser -S -G ${NAME} ${NAME}

COPY dist/$TARGETOS/$TARGETARCH/consul-terraform-sync /bin/consul-terraform-sync
COPY LICENSE /usr/share/doc/$PRODUCT_NAME/LICENSE.txt

### Added for CTS
RUN mkdir -p /consul-terraform-sync/config \
Expand Down

0 comments on commit df5f557

Please sign in to comment.