blob: cafbd5110705140bc16b815b99207f85a4c6ed27 [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
19set -e -o pipefail
20
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'
37ANNOTATIONS=${ANNOTATIONS:-""}
38helm upgrade --install ingress-nginx ingress-nginx \
39 --repo https://kubernetes.github.io/ingress-nginx --version ${NGINX_VERSION} \
40 --namespace ingress-nginx --create-namespace ${ANNOTATIONS}
41
42# Wait until ready
43kubectl wait --namespace ingress-nginx \
44 --for=condition=ready pod \
45 --selector=app.kubernetes.io/component=controller \
46 --timeout=120s
47
48#####################################################################
49
50
51############################ Gitea
52m "\n#####################################################################" "${CYAN}"
53m "(2/3) Installing Gitea..." "${CYAN}"
54m "#####################################################################\n" "${CYAN}"
55
56# Enter the Gitea folder
57pushd gitea > /dev/null
58
59# Install Gitea and expose web with Ingress
60export GITEA_CHART_VALUES_FILE=${GITEA_CHART_VALUES_FILE:-values-standalone-ingress.yaml}
61./ALL-IN-ONE-Gitea-install.sh
62
63# Provision for OSM
64m "\nProvisioning Gitea for OSM use..."
65source "${CREDENTIALS_DIR}/gitea_environment.rc"
66./90-provision-gitea-for-osm.sh
67
68# Return to base folder
69popd > /dev/null
70
71#####################################################################
72
73
74############################ Minio
75m "\n#####################################################################" "${CYAN}"
76m "(3/3) Installing Minio..." "${CYAN}"
77m "#####################################################################\n" "${CYAN}"
78
79export INSTALL_MINIO=${INSTALL_MINIO:-"y"}
80
81if [ -n "${INSTALL_MINIO}" ]; then
82 # Enter the Minio folder
83 pushd minio > /dev/null
84 # Install Minio and expose Console and tenant endpoint with Ingress
85 ./ALL-IN-ONE-Minio-install.sh
86 # Return to base folder
87 popd > /dev/null
88fi
89#####################################################################