Skip to content

Commit

Permalink
using checkout instead of git clone
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielePalaia committed Mar 7, 2024
1 parent 69ddf31 commit ff74b17
Showing 1 changed file with 35 additions and 13 deletions.
48 changes: 35 additions & 13 deletions .github/workflows/testing_and_publishing_OLM_bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
name: test-and-publish-OLM-bundle

on:
release:
types: [published]
push:
# Pattern matched against refs/tags
branches:
- "testing_olm"

workflow_dispatch:

Expand All @@ -31,6 +33,11 @@ jobs:
- 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')
Expand All @@ -53,8 +60,6 @@ jobs:
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/messaging-topology-operator/messaging-topology-operator
git clone https://github.com/rabbitmq/OLM-Package-Repo
make generate-manifests
cp ./releases/messaging-topology-operator-with-certmanager.yaml ./OLM-Package-Repo/generate_OLM/generate_OLM_messaging_topology_operator/manifests_crds/
cp ./config/crd/bases/*.yaml ./OLM-Package-Repo/generate_OLM/generate_OLM_messaging_topology_operator/manifests_crds/crds
Expand Down Expand Up @@ -87,11 +92,19 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Get Openshift connection info kubeconf from infrastructure repo - test
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GIT_HUB_ACCESS_INFRA_REPO_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_ACCESS_INFRA_REPO_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/[email protected]
with:
Expand All @@ -104,7 +117,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
Expand All @@ -123,8 +135,8 @@ jobs:
export KUBECONFIG=./infrastructure/k8s/okd/admin-kubeconfig.yaml
kubectl config use-context admin
./OLM-Package-Repo/testfiles/uninstall-rabbitmq-messaging-topology-operator.sh $BUNDLE_VERSION
publish-bundle:
publish-bundle:
name: Publish on OperatorHub and Openshift market-place
runs-on: ubuntu-latest
needs: test-olm-package
Expand All @@ -133,6 +145,18 @@ 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: |
Expand All @@ -153,7 +177,6 @@ jobs:
run: |
git config --global user.name "DanielePalaia"
git config --global user.email "[email protected]"
git clone https://github.com/rabbitmq/community-operators
cd community-operators/operators/rabbitmq-messaging-topology-operator/
git branch rabbitmq-messaging-topology-operator-$BUNDLE_VERSION
git checkout rabbitmq-messaging-topology-operator-$BUNDLE_VERSION
Expand All @@ -170,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-messaging-topology-operator/
git branch rabbitmq-messaging-topology-operator-$BUNDLE_VERSION
git checkout rabbitmq-messaging-topology-operator-$BUNDLE_VERSION
Expand Down

0 comments on commit ff74b17

Please sign in to comment.