| garciadeblas | 8d8cd99 | 2024-05-21 16:04:14 +0200 | [diff] [blame^] | 1 | #!/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 | |
| 19 | set -e -o pipefail |
| 20 | |
| 21 | # Warning!!!: Remember to select the desired kubeconfig profile before launching this script |
| 22 | |
| 23 | export HERE=$(dirname "$(readlink --canonicalize "$BASH_SOURCE")") |
| 24 | source "${HERE}/library/functions.sh" |
| 25 | source "${HERE}/library/trap.sh" |
| 26 | |
| 27 | |
| 28 | ############################ NGINX Ingress controller |
| 29 | m "\n#####################################################################" "${CYAN}" |
| 30 | m "(1/3) Installing NGINX Ingress controller..." "${CYAN}" |
| 31 | m "#####################################################################\n" "${CYAN}" |
| 32 | |
| 33 | # Install NGINX Ingress controller (NOTE: this command is idempotent) |
| 34 | ## Uncomment for AKS: |
| 35 | NGINX_VERSION="4.10.0" |
| 36 | ANNOTATIONS='--set controller.service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-health-probe-request-path"=/healthz' |
| 37 | ANNOTATIONS=${ANNOTATIONS:-""} |
| 38 | helm 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 |
| 43 | kubectl 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 |
| 52 | m "\n#####################################################################" "${CYAN}" |
| 53 | m "(2/3) Installing Gitea..." "${CYAN}" |
| 54 | m "#####################################################################\n" "${CYAN}" |
| 55 | |
| 56 | # Enter the Gitea folder |
| 57 | pushd gitea > /dev/null |
| 58 | |
| 59 | # Install Gitea and expose web with Ingress |
| 60 | export GITEA_CHART_VALUES_FILE=${GITEA_CHART_VALUES_FILE:-values-standalone-ingress.yaml} |
| 61 | ./ALL-IN-ONE-Gitea-install.sh |
| 62 | |
| 63 | # Provision for OSM |
| 64 | m "\nProvisioning Gitea for OSM use..." |
| 65 | source "${CREDENTIALS_DIR}/gitea_environment.rc" |
| 66 | ./90-provision-gitea-for-osm.sh |
| 67 | |
| 68 | # Return to base folder |
| 69 | popd > /dev/null |
| 70 | |
| 71 | ##################################################################### |
| 72 | |
| 73 | |
| 74 | ############################ Minio |
| 75 | m "\n#####################################################################" "${CYAN}" |
| 76 | m "(3/3) Installing Minio..." "${CYAN}" |
| 77 | m "#####################################################################\n" "${CYAN}" |
| 78 | |
| 79 | export INSTALL_MINIO=${INSTALL_MINIO:-"y"} |
| 80 | |
| 81 | if [ -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 |
| 88 | fi |
| 89 | ##################################################################### |