Skip to content

Commit

Permalink
WIP2
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-cox committed Apr 29, 2024
1 parent de7c35d commit c2c8627
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions scripts/e2e-k3s-start
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ K3S_VERSION=v1.28.8+k3s1
# RANCHER_IMG_VERSION=v2.9-c9be13b09329bbee60a5f6419d500198f83c44d1-head
RANCHER_IMG_VERSION=v2.9-head
DASHBOARD_URL=127.0.0.1.sslip.io
NAMESPACE=cattle-system

DIR=$(cd $(dirname $0)/..; pwd)

Expand Down Expand Up @@ -44,7 +45,7 @@ helm repo update
# TODO: RC wire in host name to e2e tests

echo "Installing Rancher....."
kubectl create ns cattle-system
kubectl create ns $NAMESPACE
helm install rancher rancher-latest/rancher \
--namespace cattle-system \
--set "hostname=$DASHBOARD_URL" \
Expand Down Expand Up @@ -91,15 +92,25 @@ if [ "$STATUS" != "302" ]; then
fi

echo "Updating UI within Rancher container"
POD_NAME=$(kubectl get pods --selector=app=rancher -n cattle-system | tail -n 1 | cut -d ' ' -f1)
# Note - these will pick the first container within the pod, so replicas=1 above is important
POD_NAME=$(kubectl get pods --selector=app=rancher -n $NAMESPACE | tail -n 1 | cut -d ' ' -f1)
echo "POD NAME: $POD_NAME"
if [ "$POD_NAME" == "" ]; then
echo "Failed to find rancher pod"
exit 1
fi
# Note - these will pick the first container within the pod, so replicas=1 above is important
kubectl cp $DASHBOARD_DIST $POD_NAME:/usr/share/rancher/ui-dashboard/dashboard # TODO: RC probably copies folder INTO target folder
kubectl cp $EMBER_DIST $POD_NAME:/usr/share/rancher/ui # TODO: RC probably copies folder INTO target folder

kubectl exec $POD_NAME -n $NAMESPACE -- sh -c 'rm -rf /usr/share/rancher/ui-dashboard'
kubectl exec $POD_NAME -n $NAMESPACE -- sh -c 'rm -rf /usr/share/rancher/ui'

mv $DASHBOARD_DIST dashboard
mv $EMBER_DIST ui

ls -la dashboard
ls -la ui

kubectl cp dashboard $POD_NAME:/usr/share/rancher/ui-dashboard -n $NAMESPACE
kubectl cp ui $POD_NAME:/usr/share/rancher -n $NAMESPACE
# -v ${DASHBOARD_DIST}:/usr/share/rancher/ui-dashboard/dashboard \
# -v ${EMBER_DIST}:/usr/share/rancher/ui \

Expand Down

0 comments on commit c2c8627

Please sign in to comment.