Skip to content

Commit

Permalink
Added openshift.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
mmontes11 committed May 11, 2024
1 parent cf4b363 commit 25b81c5
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 21 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ jobs:
- name: Test override
run: sudo KUBECTL_VERSION=v1.25.4 bash kubernetes.sh

test-openshift:
name: Test Openshift
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Test
run: sudo bash openshift.sh

- name: Test override
run: sudo OPERATOR_SDK_VERSION=v1.34.1 bash openshift.sh

test-k9s:
name: Test k9s
runs-on: ubuntu-latest
Expand Down
21 changes: 0 additions & 21 deletions kubernetes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,6 @@ if [ -z $ARCH ]; then
exit 1
fi

# openshift-local
CRC_VERSION=2.29.0
CRC_URL=https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/crc/$CRC_VERSION/crc-linux-$ARCH.tar.xz
curl -Lo /tmp/crc.tar.xz $CRC_URL
tar -C /tmp -xvf /tmp/crc.tar.xz
mv /tmp/crc-linux-$CRC_VERSION-$ARCH/crc /usr/local/bin
chmod +x /usr/local/bin/crc

# oc
OC_URL=https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/stable-4.15/openshift-client-linux-4.15.11.tar.gz
install_tar oc $OC_URL

# opm
OPM_URL=https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/stable-4.15/opm-linux-4.15.11.tar.gz
install_tar opm $OPM_URL

# operator-sdk
OPERATOR_SDK_VERSION=${OPERATOR_SDK_VERSION:-v1.34.1}
OPERATOR_SDK_URL=https://github.com/operator-framework/operator-sdk/releases/download/$OPERATOR_SDK_VERSION/operator-sdk_linux_$ARCH
install_bin operator-sdk $OPERATOR_SDK_URL

# kubectl
KUBECTL_VERSION=${KUBECTL_VERSION:-v1.30.0}
KUBECTL_URL=https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/$ARCH/kubectl
Expand Down
33 changes: 33 additions & 0 deletions openshift.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

set -eo pipefail

source <(curl -s source https://raw.githubusercontent.com/mmontes11/k8s-scripts/main/lib.sh)

USER_HOME=$(get_user_home)
ARCH=$(get_architecture)
if [ -z $ARCH ]; then
echo "Architecture not supported"
exit 1
fi

# openshift-local
CRC_VERSION=2.29.0
CRC_URL=https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/crc/$CRC_VERSION/crc-linux-$ARCH.tar.xz
curl -Lo /tmp/crc.tar.xz $CRC_URL
tar -C /tmp -xvf /tmp/crc.tar.xz
mv /tmp/crc-linux-$CRC_VERSION-$ARCH/crc /usr/local/bin
chmod +x /usr/local/bin/crc

# oc
OC_URL=https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/stable-4.15/openshift-client-linux-4.15.11.tar.gz
install_tar oc $OC_URL

# opm
OPM_URL=https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/stable-4.15/opm-linux-4.15.11.tar.gz
install_tar opm $OPM_URL

# operator-sdk
OPERATOR_SDK_VERSION=${OPERATOR_SDK_VERSION:-v1.34.1}
OPERATOR_SDK_URL=https://github.com/operator-framework/operator-sdk/releases/download/$OPERATOR_SDK_VERSION/operator-sdk_linux_$ARCH
install_bin operator-sdk $OPERATOR_SDK_URL

0 comments on commit 25b81c5

Please sign in to comment.