From 3368f14fab500ebe9f6aeab5631dd1d5f5a453e5 Mon Sep 17 00:00:00 2001 From: John Murret Date: Tue, 27 Jun 2023 16:19:39 -0600 Subject: [PATCH] Add workflow to verify linux release packages (#17904) * adding docker files to verify linux packages. * add verifr-release-linux.yml * updating name * pass inputs directly into jobs * add other linux package platforms * remove on push * fix TARGETARCH on debian and ubuntu so it can check arm64 and amd64 * fixing amazon to use the continue line * add ubuntu i386 * fix comment lines * working * remove commented out workflow jobs * Apply suggestions from code review Co-authored-by: Nathan Coleman * update fedora and ubuntu to use latest tag --------- Co-authored-by: Nathan Coleman --- .github/workflows/verify-release-linux.yaml | 78 +++++++++++++++++++ .../docker/Verify-Release-Amazon.dockerfile | 10 +++ .../docker/Verify-Release-CentOS.dockerfile | 10 +++ .../docker/Verify-Release-Debian.dockerfile | 12 +++ .../docker/Verify-Release-Fedora.dockerfile | 10 +++ .../Verify-Release-Ubunt-i386.dockerfile | 12 +++ .../docker/Verify-Release-Ubuntu.dockerfile | 12 +++ 7 files changed, 144 insertions(+) create mode 100644 .github/workflows/verify-release-linux.yaml create mode 100644 build-support/docker/Verify-Release-Amazon.dockerfile create mode 100644 build-support/docker/Verify-Release-CentOS.dockerfile create mode 100644 build-support/docker/Verify-Release-Debian.dockerfile create mode 100644 build-support/docker/Verify-Release-Fedora.dockerfile create mode 100644 build-support/docker/Verify-Release-Ubunt-i386.dockerfile create mode 100644 build-support/docker/Verify-Release-Ubuntu.dockerfile diff --git a/.github/workflows/verify-release-linux.yaml b/.github/workflows/verify-release-linux.yaml new file mode 100644 index 0000000000..a86da7f05f --- /dev/null +++ b/.github/workflows/verify-release-linux.yaml @@ -0,0 +1,78 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +name: Verify Release - Linux + +on: + workflow_dispatch: + inputs: + packageName: + description: 'Name of consul release package (consul vs consul-enterprise)' + required: true + default: 'consul' + type: choice + options: + - consul + - consul-enterprise + version: + description: The x.y.z version (also need to specify applicable suffixes like +ent and -dev)' + required: true + type: string + +jobs: + verify-ubuntu-amd64: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - name: docker build with version + run: | + docker build \ + --build-arg PACKAGE=${{ inputs.packageName }} \ + --build-arg VERSION=${{ inputs.version }} \ + --build-arg TARGETARCH=amd64 \ + -f ./build-support/docker/Verify-Release-Ubuntu.dockerfile . + + verify-debian-amd64: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - name: docker build with version + run: | + docker build \ + --build-arg PACKAGE=${{ inputs.packageName }} \ + --build-arg VERSION=${{ inputs.version }} \ + --build-arg TARGETARCH=amd64 \ + -f ./build-support/docker/Verify-Release-Debian.dockerfile . + + verify-fedora: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - name: docker build with version + run: | + docker build \ + --build-arg PACKAGE=${{ inputs.packageName }} \ + --build-arg VERSION=${{ inputs.version }} \ + -f ./build-support/docker/Verify-Release-Fedora.dockerfile . + + verify-centos: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - name: docker build with version + run: | + docker build \ + --build-arg PACKAGE=${{ inputs.packageName }} \ + --build-arg VERSION=${{ inputs.version }} \ + -f ./build-support/docker/Verify-Release-CentOS.dockerfile . + + verify-amazon: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - name: docker build with version + run: | + docker build \ + --build-arg PACKAGE=${{ inputs.packageName }} \ + --build-arg VERSION=${{ inputs.version }} \ + -f ./build-support/docker/Verify-Release-Amazon.dockerfile . diff --git a/build-support/docker/Verify-Release-Amazon.dockerfile b/build-support/docker/Verify-Release-Amazon.dockerfile new file mode 100644 index 0000000000..591b234c3b --- /dev/null +++ b/build-support/docker/Verify-Release-Amazon.dockerfile @@ -0,0 +1,10 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +FROM amazonlinux:latest +RUN yum install -y yum-utils shadow-utils +RUN yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo +ARG PACKAGE=consul \ +ARG VERSION \ +ARG SUFFIX=1 +RUN yum install -y ${PACKAGE}-${VERSION}-${SUFFIX} diff --git a/build-support/docker/Verify-Release-CentOS.dockerfile b/build-support/docker/Verify-Release-CentOS.dockerfile new file mode 100644 index 0000000000..a2be67ac77 --- /dev/null +++ b/build-support/docker/Verify-Release-CentOS.dockerfile @@ -0,0 +1,10 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +FROM centos:7 +RUN yum install -y yum-utils +RUN yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo +ARG PACKAGE=consul \ +ARG VERSION \ +ARG SUFFIX=1 +RUN yum install -y ${PACKAGE}-${VERSION}-${SUFFIX} \ No newline at end of file diff --git a/build-support/docker/Verify-Release-Debian.dockerfile b/build-support/docker/Verify-Release-Debian.dockerfile new file mode 100644 index 0000000000..533890bca4 --- /dev/null +++ b/build-support/docker/Verify-Release-Debian.dockerfile @@ -0,0 +1,12 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +FROM debian:bullseye +RUN apt update && apt install -y software-properties-common curl gnupg +RUN curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - +ARG TARGETARCH=amd64 +RUN apt-add-repository "deb [arch=${TARGETARCH}] https://apt.releases.hashicorp.com $(lsb_release -cs) main" +ARG PACKAGE=consul \ +ARG VERSION \ +ARG SUFFIX=1 +RUN apt-get update && apt-get install -y ${PACKAGE}=${VERSION}-${SUFFIX} \ No newline at end of file diff --git a/build-support/docker/Verify-Release-Fedora.dockerfile b/build-support/docker/Verify-Release-Fedora.dockerfile new file mode 100644 index 0000000000..601751a911 --- /dev/null +++ b/build-support/docker/Verify-Release-Fedora.dockerfile @@ -0,0 +1,10 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +FROM fedora:latest +RUN dnf install -y dnf-plugins-core +RUN dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo +ARG PACKAGE=consul \ +ARG VERSION \ +ARG SUFFIX=1 +RUN dnf install -y ${PACKAGE}-${VERSION}-${SUFFIX} diff --git a/build-support/docker/Verify-Release-Ubunt-i386.dockerfile b/build-support/docker/Verify-Release-Ubunt-i386.dockerfile new file mode 100644 index 0000000000..82913b4f72 --- /dev/null +++ b/build-support/docker/Verify-Release-Ubunt-i386.dockerfile @@ -0,0 +1,12 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +FROM i386/ubuntu:latest +RUN apt update && apt install -y software-properties-common curl +RUN curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - +ARG TARGETARCH=amd64 +RUN apt-add-repository "deb [arch=${TARGETARCH}] https://apt.releases.hashicorp.com $(lsb_release -cs) main" +ARG PACKAGE=consul \ +ARG VERSION \ +ARG SUFFIX=1 +RUN apt-get update && apt-get install -y ${PACKAGE}=${VERSION}-${SUFFIX} diff --git a/build-support/docker/Verify-Release-Ubuntu.dockerfile b/build-support/docker/Verify-Release-Ubuntu.dockerfile new file mode 100644 index 0000000000..ddeffc40c5 --- /dev/null +++ b/build-support/docker/Verify-Release-Ubuntu.dockerfile @@ -0,0 +1,12 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +FROM ubuntu:latest +RUN apt update && apt install -y software-properties-common curl +RUN curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - +ARG TARGETARCH=amd64 +RUN apt-add-repository "deb [arch=${TARGETARCH}] https://apt.releases.hashicorp.com $(lsb_release -cs) main" +ARG PACKAGE=consul \ +ARG VERSION \ +ARG SUFFIX=1 +RUN apt-get update && apt-get install -y ${PACKAGE}=${VERSION}-${SUFFIX}