Skip to content

Commit

Permalink
Merge pull request #234 from openshift-instruqt/no-custom-track-scripts
Browse files Browse the repository at this point in the history
relocate custom track scripts ( for #232 )
  • Loading branch information
ryanj committed Mar 21, 2023
2 parents afd130e + 5d23433 commit 6ae4244
Show file tree
Hide file tree
Showing 36 changed files with 379 additions and 192 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
#!/bin/bash

export ODO_INSTALL="v2.5.1"
export ODO_RESPONSE=$(odo version 2> /dev/null)
export ODO_VERSION=${ODO_RESPONSE:0:10}

curl -o odo.tar.gz -L https://mirror.openshift.com/pub/openshift-v4/clients/odo/$ODO_INSTALL/odo-linux-amd64.tar.gz && \
tar -xvf odo.tar.gz && \
rm -f odo.tar.gz && \
mv -f odo /usr/bin/odo && \
chmod +x /usr/bin/odo && \
odo preference set -f ConsentTelemetry false > /dev/null 2>&1
odo preference set UpdateNotification false > /dev/null 2>&1


git clone https://github.com/openshift-evangelists/Wild-West-Backend.git ~/backend
git clone https://github.com/openshift-evangelists/Wild-West-Frontend.git ~/frontend
git clone https://github.com/openshift-evangelists/Wild-West-Frontend.git ~/frontend
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,3 @@ curl -s https://mirror.openshift.com/pub/openshift-v4/clients/ocp/$OPENSHIFT_REL
tar -xvf /tmp/openshift-client-linux-$OPENSHIFT_RELEASE_VERSION.tar.gz -C /usr/bin/
chmod +x /usr/bin/oc
chmod +x /usr/bin/kubectl

export ODO_INSTALL="v2.5.1"
export ODO_RESPONSE=$(odo version 2> /dev/null)
export ODO_VERSION=${ODO_RESPONSE:0:10}

curl -o odo.tar.gz -L https://mirror.openshift.com/pub/openshift-v4/clients/odo/$ODO_INSTALL/odo-linux-amd64.tar.gz && \
tar -xvf odo.tar.gz && \
rm -f odo.tar.gz && \
mv -f odo /usr/bin/odo && \
chmod +x /usr/bin/odo && \
odo preference set -f ConsentTelemetry false > /dev/null 2>&1
odo preference set UpdateNotification false > /dev/null 2>&1
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
set -x

# setup vars
export HOME=/root
export TERM=xterm-color
export KUBECONFIG=/opt/kubeconfig
echo "export TERM=xterm-color" >> /root/.bashrc
echo "export KUBECONFIG=/opt/kubeconfig" >> /root/.bashrc
echo "export HOME=/root" >> /root/.bashrc
echo "export HOME=/root" > /tmp/.bashrc
cat /root/.bashrc >> /tmp/.bashrc
mv /tmp/.bashrc /root/.bashrc

ENS4IP=$(ip -4 -o addr show ens4 | awk '{print $4}' | cut -d "/" -f 1)

Expand Down Expand Up @@ -80,12 +83,12 @@ fi
echo "### Boostrap START ###"
date

until oc get pods -A 2>/dev/null 1>&2; do
until oc get pods -A 2>/dev/null 1>&2; do
echo "Waiting for pods to start..";
sleep 5;
done

until oc get co 2>/dev/null 1>&2; do
until oc get co 2>/dev/null 1>&2; do
echo "Waiting for Cluster Operators to complete first rollout";
sleep 5;
done
Expand Down Expand Up @@ -180,13 +183,13 @@ do
done


### YOUR SETUP SCRIPT (E.G. INSTALL JDK, GO ETC) SHOULD GO HERE
### YOUR SETUP SCRIPT (E.G. INSTALL JDK, GO ETC) SHOULD GO HERE
# In this way we try to optimize the flow while we wait for oauth and routes to be finally OK
# https://bugzilla.redhat.com/show_bug.cgi?id=2082539

###

until [[ `oc get routes -A | awk '!/^(NAME|openshift-ingress-canary)/{print$3}' |grep $HOSTNAME` ]]; do
until [[ `oc get routes -A | awk '!/^(NAME|openshift-ingress-canary)/{print$3}' |grep $HOSTNAME` ]]; do
echo "Routes not patched yet, waiting 30 seconds..";
sleep 30;
done
Expand Down Expand Up @@ -223,12 +226,23 @@ do
done

# Wait until web console is available
until curl -k https://console-openshift-console.$HOSTNAME.crc.$INSTRUQT_PARTICIPANT_ID.instruqt.io > /dev/null 2>/dev/null
while [ "$(oc rollout status deploy console -n openshift-console)" != "deployment \"console\" successfully rolled out" ]
do
echo "Waiting for web console - not available yet"
sleep 6
echo "Waiting for web console - rollout incomplete"
sleep 5
done

while [ "$(curl -k -I https://console-openshift-console.$HOSTNAME.crc.$INSTRUQT_PARTICIPANT_ID.instruqt.io -o /dev/null -w '%{http_code}\n' -s 2>/dev/null)" != "200" ]
do
echo "Waiting for web console - unavailable via curl"
sleep 5
done

while [ "$(oc rollout status deploy apiserver -n openshift-oauth-apiserver)" != "deployment \"apiserver\" successfully rolled out" ]
do
echo "Waiting for oauth API - rollout incomplete"
sleep 5
done

echo $(date)
echo "### Boostrap END ###"

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

curl https://raw.githubusercontent.com/openshift-instruqt/instruqt/master/scripts/install_java_graalvm.sh | bash

mkdir -p /root/projects/quarkus
echo "-w \"\n\"" >> ~/.curlrc
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,9 @@ tags:
owner: openshift
developers:
- doh@redhat.com
checksum: "6996442897705959574"
- ryanj@redhat.com
lab_config:
overlay: false
width: 25
position: right
checksum: "8139498506585746495"
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
set -x

# setup vars
export HOME=/root
export TERM=xterm-color
export KUBECONFIG=/opt/kubeconfig
echo "export TERM=xterm-color" >> /root/.bashrc
echo "export KUBECONFIG=/opt/kubeconfig" >> /root/.bashrc
echo "export HOME=/root" >> /root/.bashrc
echo "export HOME=/root" > /tmp/.bashrc
cat /root/.bashrc >> /tmp/.bashrc
mv /tmp/.bashrc /root/.bashrc

ENS4IP=$(ip -4 -o addr show ens4 | awk '{print $4}' | cut -d "/" -f 1)

Expand Down Expand Up @@ -80,12 +83,12 @@ fi
echo "### Boostrap START ###"
date

until oc get pods -A 2>/dev/null 1>&2; do
until oc get pods -A 2>/dev/null 1>&2; do
echo "Waiting for pods to start..";
sleep 5;
done

until oc get co 2>/dev/null 1>&2; do
until oc get co 2>/dev/null 1>&2; do
echo "Waiting for Cluster Operators to complete first rollout";
sleep 5;
done
Expand Down Expand Up @@ -180,19 +183,13 @@ do
done


### YOUR SETUP SCRIPT (E.G. INSTALL JDK, GO ETC) SHOULD GO HERE
### YOUR SETUP SCRIPT (E.G. INSTALL JDK, GO ETC) SHOULD GO HERE
# In this way we try to optimize the flow while we wait for oauth and routes to be finally OK
# https://bugzilla.redhat.com/show_bug.cgi?id=2082539

export HOME="/root"
curl https://raw.githubusercontent.com/openshift-instruqt/instruqt/master/scripts/install_java_graalvm.sh | bash

mkdir -p /root/projects/quarkus
echo "-w \"\n\"" >> ~/.curlrc

###

until [[ `oc get routes -A | awk '!/^(NAME|openshift-ingress-canary)/{print$3}' |grep $HOSTNAME` ]]; do
until [[ `oc get routes -A | awk '!/^(NAME|openshift-ingress-canary)/{print$3}' |grep $HOSTNAME` ]]; do
echo "Routes not patched yet, waiting 30 seconds..";
sleep 30;
done
Expand Down Expand Up @@ -229,11 +226,23 @@ do
done

# Wait until web console is available
until curl -k https://console-openshift-console.$HOSTNAME.crc.$INSTRUQT_PARTICIPANT_ID.instruqt.io > /dev/null 2>/dev/null
while [ "$(oc rollout status deploy console -n openshift-console)" != "deployment \"console\" successfully rolled out" ]
do
echo "Waiting for web console - rollout incomplete"
sleep 5
done

while [ "$(curl -k -I https://console-openshift-console.$HOSTNAME.crc.$INSTRUQT_PARTICIPANT_ID.instruqt.io -o /dev/null -w '%{http_code}\n' -s 2>/dev/null)" != "200" ]
do
echo "Waiting for web console - not available yet"
sleep 6
echo "Waiting for web console - unavailable via curl"
sleep 5
done

while [ "$(oc rollout status deploy apiserver -n openshift-oauth-apiserver)" != "deployment \"apiserver\" successfully rolled out" ]
do
echo "Waiting for oauth API - rollout incomplete"
sleep 5
done

echo $(date)
echo "### Boostrap END ###"
echo "### Boostrap END ###"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

curl https://raw.githubusercontent.com/openshift-instruqt/instruqt/master/scripts/install_java_graalvm.sh | bash

mkdir -p /root/projects/quarkus
echo "-w \"\n\"" >> ~/.curlrc
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,8 @@ developers:
- eshortis@redhat.com
- ryanj@redhat.com
- cclyburn@redhat.com
checksum: "8999125421394163673"
lab_config:
overlay: false
width: 25
position: right
checksum: "12256582685278091631"
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
set -x

# setup vars
export HOME=/root
export TERM=xterm-color
export KUBECONFIG=/opt/kubeconfig
echo "export TERM=xterm-color" >> /root/.bashrc
echo "export KUBECONFIG=/opt/kubeconfig" >> /root/.bashrc
echo "export HOME=/root" >> /root/.bashrc
echo "export HOME=/root" > /tmp/.bashrc
cat /root/.bashrc >> /tmp/.bashrc
mv /tmp/.bashrc /root/.bashrc

ENS4IP=$(ip -4 -o addr show ens4 | awk '{print $4}' | cut -d "/" -f 1)

Expand Down Expand Up @@ -80,12 +83,12 @@ fi
echo "### Boostrap START ###"
date

until oc get pods -A 2>/dev/null 1>&2; do
until oc get pods -A 2>/dev/null 1>&2; do
echo "Waiting for pods to start..";
sleep 5;
done

until oc get co 2>/dev/null 1>&2; do
until oc get co 2>/dev/null 1>&2; do
echo "Waiting for Cluster Operators to complete first rollout";
sleep 5;
done
Expand Down Expand Up @@ -180,19 +183,13 @@ do
done


### YOUR SETUP SCRIPT (E.G. INSTALL JDK, GO ETC) SHOULD GO HERE
### YOUR SETUP SCRIPT (E.G. INSTALL JDK, GO ETC) SHOULD GO HERE
# In this way we try to optimize the flow while we wait for oauth and routes to be finally OK
# https://bugzilla.redhat.com/show_bug.cgi?id=2082539

export HOME="/root"
curl https://raw.githubusercontent.com/openshift-instruqt/instruqt/master/scripts/install_java_graalvm.sh | bash

mkdir -p /root/projects/quarkus
echo "-w \"\n\"" >> ~/.curlrc

###

until [[ `oc get routes -A | awk '!/^(NAME|openshift-ingress-canary)/{print$3}' |grep $HOSTNAME` ]]; do
until [[ `oc get routes -A | awk '!/^(NAME|openshift-ingress-canary)/{print$3}' |grep $HOSTNAME` ]]; do
echo "Routes not patched yet, waiting 30 seconds..";
sleep 30;
done
Expand Down Expand Up @@ -229,13 +226,23 @@ do
done

# Wait until web console is available
until curl -k https://console-openshift-console.$HOSTNAME.crc.$INSTRUQT_PARTICIPANT_ID.instruqt.io > /dev/null 2>/dev/null
while [ "$(oc rollout status deploy console -n openshift-console)" != "deployment \"console\" successfully rolled out" ]
do
echo "Waiting for web console - not available yet"
sleep 6
echo "Waiting for web console - rollout incomplete"
sleep 5
done

echo $(date)
echo "### Boostrap END ###"
while [ "$(curl -k -I https://console-openshift-console.$HOSTNAME.crc.$INSTRUQT_PARTICIPANT_ID.instruqt.io -o /dev/null -w '%{http_code}\n' -s 2>/dev/null)" != "200" ]
do
echo "Waiting for web console - unavailable via curl"
sleep 5
done

while [ "$(oc rollout status deploy apiserver -n openshift-oauth-apiserver)" != "deployment \"apiserver\" successfully rolled out" ]
do
echo "Waiting for oauth API - rollout incomplete"
sleep 5
done

echo $(date)
echo "### Boostrap END ###"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
slug: 01-create-project
id: imxvjugrfsbe
id: ghga9mnfy7cx
type: challenge
title: Topic 1 - Getting Quarkus up and running
notes:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

curl https://raw.githubusercontent.com/openshift-instruqt/instruqt/master/scripts/install_java.sh | bash

mkdir -p /root/projects/quarkus
echo "-w \"\n\"" >> ~/.curlrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
slug: 02-create-data
id: fmuhxrr2pi8u
id: ghijsowccuax
type: challenge
title: Topic 2 - Adding data access to the demonstration application
notes:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
slug: 03-create-beans
id: t6evb7iomu56
id: sf8e3buti9wj
type: challenge
title: Topic 3 - Implementing Spring dependency injection in Quarkus
notes:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
slug: 04-create-web
id: hzrtwdnsftay
id: cb4pzwjwr1hz
type: challenge
title: Topic 4 - Using Spring Web Annotations in Quarkus
notes:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
slug: 05-build-app
id: xtjih5fygpbg
id: e0ipxscuv6x2
type: challenge
title: Topic 5 - Running the demonstration app in an executable JAR
notes:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
slug: 06-deploy-and-test
id: mcytmiyjo17p
id: lja0lxe02nmg
type: challenge
title: Topic 6 - Creating a Quarkus native app running in OpenShift
notes:
Expand Down
6 changes: 5 additions & 1 deletion instruqt-tracks/developing-with-quarkus-spring/track.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ developers:
- cclyburn@redhat.com
- doh@redhat.com
- eshortis@redhat.com
checksum: "16426600082753254971"
lab_config:
overlay: false
width: 25
position: right
checksum: "12639428468379033496"
Loading

0 comments on commit 6ae4244

Please sign in to comment.