Skip to content

Commit

Permalink
let's try this again
Browse files Browse the repository at this point in the history
  • Loading branch information
NiniOak committed Oct 1, 2024
1 parent 9e4a5a0 commit fae7ec9
Showing 1 changed file with 24 additions and 27 deletions.
51 changes: 24 additions & 27 deletions .github/workflows/openshift-acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,56 +10,53 @@ on:
# - cron: '0 6 * * 1,3,5'

jobs:
openshift:
runs-on: ubuntu-22.04
test-consul-on-openshift:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
fetch-depth: 0


- name: Set up OpenShift CLI
- name: Install dependencies
run: |
OPENSHIFT_CLIENT_URL="https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz"
curl -sL ${OPENSHIFT_CLIENT_URL} | tar -xzf - -C /tmp
sudo mv /tmp/oc /usr/local/bin/
oc version
sudo apt-get update
sudo apt-get install -y qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils
- name: Set up OpenShift Local
run: |
CRC_URL="https://mirror.openshift.com/pub/openshift-v4/clients/crc/latest/crc-linux-amd64.tar.xz"
curl -sL ${CRC_URL} | tar -xJf - -C /tmp
sudo mv /tmp/crc-linux-*-amd64/crc /usr/local/bin/
CRC_URL=$(curl -s https://mirror.openshift.com/pub/openshift-v4/clients/crc/latest/sha256sum.txt | grep linux-amd64 | cut -d' ' -f2)
curl -sL https://mirror.openshift.com/pub/openshift-v4/clients/crc/latest/$CRC_URL -o crc-linux-amd64.tar.xz
tar -xvf crc-linux-amd64.tar.xz
sudo mv crc-linux-*-amd64/crc /usr/local/bin/
crc version
crc setup
crc start --memory 12288 --cpus 4
crc config set consent-telemetry no
crc start --memory 13312 --cpus 4 --yes
- name: Login to OpenShift
- name: Set up OpenShift CLI
run: |
eval $(crc oc-env)
oc login -u kubeadmin -p $(crc console --credentials | grep kubeadmin | awk '{print $2}')
- name: Set up Helm
oc version
- name: Login to OpenShift
run: |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
eval $(crc oc-env)
oc login -u developer -p developer https://api.crc.testing:6443 --insecure-skip-tls-verify=true
- name: Install Consul
run: |
helm repo add hashicorp https://helm.releases.hashicorp.com
helm repo update
helm install consul hashicorp/consul --set global.name=consul
- name: Install helm
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
with:
version: 'v3.9.4'

- name: Wait for Consul to be ready
run: |
kubectl wait --for=condition=ready pod -l app=consul --timeout=300s
oc wait --for=condition=ready pod -l app=consul --timeout=300s
- name: Run Consul Acceptance Tests
- name: Run Acceptance Tests
run: |
# Add your Consul tests here
kubectl exec $(kubectl get pod -l app=consul -o jsonpath="{.items[0].metadata.name}") -- consul members
oc exec $(oc get pod -l app=consul -o jsonpath="{.items[0].metadata.name}") -- consul members
- name: Cleanup
if: always()
Expand Down

0 comments on commit fae7ec9

Please sign in to comment.