#!/usr/bin/env bash # Copyright © 2023 - 2024 SUSE LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. set -xe RANCHER_HOSTNAME=$1 if [ -z "$RANCHER_HOSTNAME" ]; then echo "You must pass a rancher host name" exit 1 fi RANCHER_CHANNEL=${RANCHER_CHANNEL:-alpha} RANCHER_PASSWORD=${RANCHER_PASSWORD:-rancheradmin} RANCHER_VERSION=${RANCHER_VERSION:-v2.13.0-alpha3} RANCHER_IMAGE_TAG=${RANCHER_IMAGE_TAG:-$RANCHER_VERSION} # Set RANCHER_IMAGE_TAG=head to test with latest build RANCHER_IMAGE=${RANCHER_IMAGE:-rancher/rancher:$RANCHER_IMAGE_TAG} CLUSTER_NAME=${CLUSTER_NAME:-capi-test} USE_TILT_DEV=${USE_TILT_DEV:-true} TURTLES_VERSION=${TURTLES_VERSION:-dev} TURTLES_IMAGE=${TURTLES_IMAGE:-ghcr.io/rancher/turtles:$TURTLES_VERSION} GITEA_PASSWORD=${GITEA_PASSWORD:-giteaadmin} RANCHER_CHARTS_REPO_DIR=${RANCHER_CHARTS_REPO_DIR} RANCHER_CHART_DEV_VERSION=${RANCHER_CHART_DEV_VERSION} RANCHER_CHARTS_BASE_BRANCH=${RANCHER_CHARTS_BASE_BRANCH} BASEDIR=$(dirname "$0") kind create cluster --config "$BASEDIR/kind-cluster-with-extramounts.yaml" --name $CLUSTER_NAME docker pull $RANCHER_IMAGE kind load docker-image $RANCHER_IMAGE --name $CLUSTER_NAME kubectl rollout status deployment coredns -n kube-system --timeout=90s helm repo add rancher-$RANCHER_CHANNEL https://releases.rancher.com/server-charts/$RANCHER_CHANNEL --force-update helm repo add jetstack https://charts.jetstack.io --force-update helm repo add ngrok https://charts.ngrok.com --force-update helm repo add gitea-charts https://dl.gitea.com/charts/ --force-update helm repo update helm install cert-manager jetstack/cert-manager \ --namespace cert-manager \ --create-namespace \ --set crds.enabled=true helm upgrade ngrok ngrok/ngrok-operator \ --namespace ngrok \ --create-namespace \ --install \ --wait \ --timeout 5m \ --set credentials.apiKey=$NGROK_API_KEY \ --set credentials.authtoken=$NGROK_AUTHTOKEN kubectl apply -f test/e2e/data/rancher/ingress-class-patch.yaml helm install gitea gitea-charts/gitea \ -f test/e2e/data/gitea/values.yaml \ --set gitea.admin.password=$GITEA_PASSWORD \ --wait envsubst