From 01bdda49d21804721abcbc961a3331a3c38bea93 Mon Sep 17 00:00:00 2001 From: David Enyeart Date: Wed, 17 Jul 2024 13:54:13 -0400 Subject: [PATCH 1/2] Enable github actions workflow_dispatch workflow_dispatch will enable starting the github actions from github UI. Signed-off-by: David Enyeart --- .github/workflows/endtoend-tests.yaml | 1 + .github/workflows/image-build-pr.yaml | 1 + .github/workflows/image-build.yaml | 1 + .github/workflows/integration-tests.yaml | 1 + .github/workflows/unit-tests.yaml | 1 + 5 files changed, 5 insertions(+) diff --git a/.github/workflows/endtoend-tests.yaml b/.github/workflows/endtoend-tests.yaml index d250b196..e2cd936e 100644 --- a/.github/workflows/endtoend-tests.yaml +++ b/.github/workflows/endtoend-tests.yaml @@ -22,6 +22,7 @@ on: branches: [main] pull_request: branches: [main] + workflow_dispatch: jobs: suite: diff --git a/.github/workflows/image-build-pr.yaml b/.github/workflows/image-build-pr.yaml index fa162491..b5cd9839 100644 --- a/.github/workflows/image-build-pr.yaml +++ b/.github/workflows/image-build-pr.yaml @@ -3,6 +3,7 @@ name: Build Operator image on: pull_request: branches: [main] + workflow_dispatch: jobs: image: diff --git a/.github/workflows/image-build.yaml b/.github/workflows/image-build.yaml index 2340f70b..8ef98c31 100644 --- a/.github/workflows/image-build.yaml +++ b/.github/workflows/image-build.yaml @@ -3,6 +3,7 @@ name: Build and Push Operator image on: push: branches: [main] + workflow_dispatch: jobs: image: diff --git a/.github/workflows/integration-tests.yaml b/.github/workflows/integration-tests.yaml index 87e15e90..71b2bc40 100644 --- a/.github/workflows/integration-tests.yaml +++ b/.github/workflows/integration-tests.yaml @@ -22,6 +22,7 @@ on: branches: [main] pull_request: branches: [main] + workflow_dispatch: env: KUBECONFIG_PATH: /tmp/kubeconfig.yaml diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index 1b63abc1..fc2c1e4f 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -23,6 +23,7 @@ on: branches: [main] pull_request: branches: [main] + workflow_dispatch: env: GO_VER: "1.20" From 39e12abb5f6bb1a0a5d6dda28e50b69b2259d484 Mon Sep 17 00:00:00 2001 From: David Enyeart Date: Wed, 17 Jul 2024 21:30:20 -0400 Subject: [PATCH 2/2] Use ubi-minimal image instead of ubi go-toolset go-toolset doesn't have the latest versions of Go. Therefore use the ubi minimal image and install our preferred version of Go when building operator. Signed-off-by: David Enyeart --- Dockerfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2018dd21..0a92ce6c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,16 @@ ARG GO_VER ########## Build operator binary ########## -FROM registry.access.redhat.com/ubi8/go-toolset:$GO_VER as builder +FROM registry.access.redhat.com/ubi8/ubi-minimal as builder + +ARG GO_VER +ARG ARCH + +# gcc required for cgo +RUN microdnf install -y tar gzip gcc + +RUN curl -sL https://go.dev/dl/go${GO_VER}.linux-${ARCH}.tar.gz | tar zxf - -C /usr/local +ENV PATH="/usr/local/go/bin:$PATH" COPY . /go/src/github.com/IBM-Blockchain/fabric-operator WORKDIR /go/src/github.com/IBM-Blockchain/fabric-operator