blob: ddd3cbfdf7e61f889d0f6422dcb5bf1c6827265c [file] [log] [blame]
garciadeblas8d8cd992024-05-21 16:04:14 +02001#!/bin/bash
2#######################################################################################
3# Copyright ETSI Contributors and Others.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14# implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#######################################################################################
18
garciadeblas7c473cb2024-08-22 10:13:00 +020019set -e -o pipefail
garciadeblas8d8cd992024-05-21 16:04:14 +020020
21# Warning!!!: Remember to select the desired kubeconfig profile before launching this script
22
23export HERE=$(dirname "$(readlink --canonicalize "$BASH_SOURCE")")
24source "${HERE}/library/functions.sh"
25source "${HERE}/library/trap.sh"
26
27
28############################ NGINX Ingress controller
29m "\n#####################################################################" "${CYAN}"
30m "(1/3) Installing NGINX Ingress controller..." "${CYAN}"
31m "#####################################################################\n" "${CYAN}"
32
33# Install NGINX Ingress controller (NOTE: this command is idempotent)
34## Uncomment for AKS:
35NGINX_VERSION="4.10.0"
36ANNOTATIONS='--set controller.service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-health-probe-request-path"=/healthz'
garciadeblas8d8cd992024-05-21 16:04:14 +020037helm upgrade --install ingress-nginx ingress-nginx \
38 --repo https://kubernetes.github.io/ingress-nginx --version ${NGINX_VERSION} \
39 --namespace ingress-nginx --create-namespace ${ANNOTATIONS}
40
41# Wait until ready
42kubectl wait --namespace ingress-nginx \
43 --for=condition=ready pod \
44 --selector=app.kubernetes.io/component=controller \
45 --timeout=120s
46
47#####################################################################
48
49
50############################ Gitea
51m "\n#####################################################################" "${CYAN}"
52m "(2/3) Installing Gitea..." "${CYAN}"
53m "#####################################################################\n" "${CYAN}"
54
55# Enter the Gitea folder
56pushd gitea > /dev/null
57
58# Install Gitea and expose web with Ingress
59export GITEA_CHART_VALUES_FILE=${GITEA_CHART_VALUES_FILE:-values-standalone-ingress.yaml}
60./ALL-IN-ONE-Gitea-install.sh
61
62# Provision for OSM
63m "\nProvisioning Gitea for OSM use..."
64source "${CREDENTIALS_DIR}/gitea_environment.rc"
65./90-provision-gitea-for-osm.sh
66
67# Return to base folder
68popd > /dev/null
69
70#####################################################################
71
72
73############################ Minio
74m "\n#####################################################################" "${CYAN}"
75m "(3/3) Installing Minio..." "${CYAN}"
76m "#####################################################################\n" "${CYAN}"
77
garciadeblas8d8cd992024-05-21 16:04:14 +020078if [ -n "${INSTALL_MINIO}" ]; then
79 # Enter the Minio folder
80 pushd minio > /dev/null
81 # Install Minio and expose Console and tenant endpoint with Ingress
82 ./ALL-IN-ONE-Minio-install.sh
83 # Return to base folder
84 popd > /dev/null
85fi
86#####################################################################