From 9e4042eaefe2dd39d7e020c86aee2fbd84618cad Mon Sep 17 00:00:00 2001 From: Daniele Palaia Date: Thu, 7 Mar 2024 11:38:13 +0100 Subject: [PATCH] using checkout instead of cloning --- .../testing_and_publishing_OLM_bundle.yml | 52 +++++++++++++------ 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/.github/workflows/testing_and_publishing_OLM_bundle.yml b/.github/workflows/testing_and_publishing_OLM_bundle.yml index 39864138a..b97768966 100644 --- a/.github/workflows/testing_and_publishing_OLM_bundle.yml +++ b/.github/workflows/testing_and_publishing_OLM_bundle.yml @@ -3,14 +3,16 @@ name: test-and-publish-OLM-bundle on: - release: - types: [published] - + push: + # Pattern matched against refs/tags + branches: + - "testing_olm" workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true + env: # registry information where we want to store the operator image and the operator index image DOCKER_REGISTRY_SERVER: quay.io/rabbitmqoperator @@ -30,7 +32,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - + - name: Checkout OLM-Package-Repo + uses: actions/checkout@v4 + with: + repository: rabbitmq/OLM-Package-Repo + path: ./OLM-Package-Repo - name: Set tag image for tagged version if: startsWith(github.ref, 'refs/tags/v') @@ -53,9 +59,7 @@ jobs: BUNDLE_VERSION: ${{ env.BUNDLE_VERSION }} run: | sed '/mount_program =/s/^#//' -i /etc/containers/storage.conf - podman login quay.io -u $username -p $password - git config --global --add safe.directory /__w/cluster-operator/cluster-operator - git clone https://github.com/rabbitmq/OLM-Package-Repo + podman login quay.io -u $username -p $password make generate-installation-manifest cp ./config/crd/bases/rabbitmq.com_rabbitmqclusters.yaml ./OLM-Package-Repo/generate_OLM/generate_OLM_cluster_operator/manifests_crds/crds.yaml cp ./releases/cluster-operator.yml ./OLM-Package-Repo/generate_OLM/generate_OLM_cluster_operator/manifests_crds/cluster-operator.yaml @@ -87,12 +91,17 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - - name: Get Openshift connection info kubeconf from infrastructure repo - env: - GITHUB_ACCESS_TOKEN: ${{ secrets.GIT_HUB_INFRA_REPO_ACCESS_TOKEN }} - run: | - git clone https://oauth2:"$GITHUB_ACCESS_TOKEN"@github.com/rabbitmq/infrastructure + - name: Checkout infrastructure repo + uses: actions/checkout@v4 + with: + repository: rabbitmq/infrastructure + token: ${{ secrets.GIT_HUB_INFRA_REPO_ACCESS_TOKEN }} + path: ./infrastructure + - name: Checkout OLM-Package-Repo + uses: actions/checkout@v4 + with: + repository: rabbitmq/OLM-Package-Repo + path: ./OLM-Package-Repo - name: Protect access to the cluster with a mutex uses: ben-z/gh-action-mutex@v1.0-alpha-8 @@ -104,7 +113,6 @@ jobs: TOKEN: ${{ secrets.OPERATORHUB_TOKEN }} BUNDLE_VERSION: ${{ env.BUNDLE_VERSION }} run: | - git clone https://github.com/rabbitmq/OLM-Package-Repo mkdir $HOME/.kube cp ./infrastructure/k8s/okd/admin-kubeconfig.yaml $HOME/.kube/config export KUBECONFIG=$HOME/.kube/config @@ -125,7 +133,6 @@ jobs: ./OLM-Package-Repo/testfiles/uninstall-rabbitmq-cluster-operator.sh $BUNDLE_VERSION publish-bundle: - name: Publish on OperatorHub and Openshift market-place runs-on: ubuntu-latest needs: test-olm-package @@ -134,6 +141,19 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Checkout community-operators repo + uses: actions/checkout@v4 + with: + repository: rabbitmq/community-operators + path: ./community-operators + token: ${{ secrets.OPERATORHUB_TOKEN }} + - name: Checkout community-operators-prod repo + uses: actions/checkout@v4 + with: + repository: rabbitmq/community-operators-prod + path: ./community-operators-prod + token: ${{ secrets.OPERATORHUB_TOKEN }} + - name: Set tag image for tagged version if: startsWith(github.ref, 'refs/tags/v') run: | @@ -156,7 +176,6 @@ jobs: run: | git config --global user.name "DanielePalaia" git config --global user.email "dpalaia@vmware.com" - git clone https://github.com/rabbitmq/community-operators mkdir -p community-operators/operators/rabbitmq-cluster-operator cd community-operators/operators/rabbitmq-cluster-operator git branch rabbitmq-cluster-operator-$BUNDLE_VERSION @@ -174,7 +193,6 @@ jobs: TOKEN: ${{ secrets.OPERATORHUB_TOKEN }} BUNDLE_VERSION: ${{ env.BUNDLE_VERSION }} run: | - git clone https://github.com/rabbitmq/community-operators-prod cd community-operators-prod/operators/rabbitmq-cluster-operator git branch rabbitmq-cluster-operator-$BUNDLE_VERSION git checkout rabbitmq-cluster-operator-$BUNDLE_VERSION