Skip to content

Commit

Permalink
install oc cli in github action containers
Browse files Browse the repository at this point in the history
  • Loading branch information
TimCsaky committed Dec 24, 2024
1 parent 624829f commit 78f9189
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/actions/deploy-to-environment/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ runs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install CLI tools from OpenShift Mirror
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4"

- name: Login to OpenShift Cluster
uses: redhat-actions/oc-login@v1
with:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/on-pr-closed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install CLI tools from OpenShift Mirror
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4"
- name: Login to OpenShift Cluster
uses: redhat-actions/oc-login@v1
with:
Expand All @@ -50,7 +54,7 @@ jobs:
CURRENT_USERS=$(oc get PostgresCluster/postgres-master -o json | jq '.spec.users')
echo "${CURRENT_USERS}"
# Remove the user from the list,
# Remove the user from the list,
UPDATED_USERS=$(echo "${CURRENT_USERS}" | jq --argjson user "${USER_TO_REMOVE}" 'map(select(. != $user))')
PATCH_JSON=$(jq -n --argjson users "${UPDATED_USERS}" '{"spec": {"users": $users}}')
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/on-pr-opened.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ jobs:
needs: build
timeout-minutes: 12
steps:
# TODO: does pr-123 user need to own database pr-123 in order to connect run knex migrations?
- name: Install CLI tools from OpenShift Mirror
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4"
- name: Login to OpenShift Cluster
uses: redhat-actions/oc-login@v1
with:
Expand Down

0 comments on commit 78f9189

Please sign in to comment.