m "(3/3) Installing Minio..." "${CYAN}"
m "#####################################################################\n" "${CYAN}"
-export INSTALL_MINIO=${INSTALL_MINIO:-"y"}
-
if [ -n "${INSTALL_MINIO}" ]; then
# Enter the Minio folder
pushd minio > /dev/null
# Transitent file to be sourced to bootstrap some key variables
# Random passwords
-export GITEA_ADMINISTRATOR_PASSWORD=$(apg -a 1 -M sncl -n 1 -m 12 -x 12 -E \\\*\'\"\`\$\<\{\})
-export GITEA_STD_USER_PASS=$(apg -a 1 -M sncl -n 1 -m 10 -x 10 -E \\\*\'\"\`\$\<\{\})
+export GITEA_ADMINISTRATOR_PASSWORD=$(apg -a 1 -M sncl -n 1 -m 12 -x 12 -E \\\*\'\"\`\$\<\>\{\})
+export GITEA_STD_USER_PASS=$(apg -a 1 -M sncl -n 1 -m 10 -x 10 -E \\\*\'\"\`\$\<\>\{\})
# Uncomment to deploy Gitea only as ClusterIP service (i.e., no LoadBalancer)
# export GITEA_CHART_VALUES_FILE=values-all.yaml
# limitations under the License.
#######################################################################################
-set -e
+set -ex
export HERE=$(dirname "$(readlink --canonicalize "$BASH_SOURCE")")
source "${HERE}/library/functions.sh"
--namespace=gitea \
--values "${HERE}/${GITEA_CHART_VALUES_FILE}" \
--set=gitea.admin.username="${GITEA_ADMINISTRATOR_USERNAME}" \
- --set=gitea.admin.password="${GITEA_ADMINISTRATOR_PASSWORD}" \
+ --set=gitea.admin.password="${GITEA_ADMINISTRATOR_PASSWORD@Q}" \
--set=gitea.config.server.DOMAIN="${GITEA_SSH_SERVER}" \
--set=gitea.config.server.ROOT_URL="${GITEA_HTTP_URL}" \
--set=ingress.hosts[0].host="${GITEA_HTTP_HOST_DOMAIN}" \
KUBECONFIG_OLD=${KUBECONFIG:-"$HOME/.kube/config"}
export CREDENTIALS_DIR="${OSM_HOME_DIR}/.credentials"
export WORK_REPOS_DIR="${OSM_HOME_DIR}/repos"
-export INSTALL_MINIO=${INSTALL_MINIO:-""}
+export INSTALL_MINIO=${INSTALL_MINIO:-"y"}
echo "DEBUG_INSTALL=$DEBUG_INSTALL"
echo "OSM_DEVOPS=$OSM_DEVOPS"
echo "OSM_HOME_DIR=$OSM_HOME_DIR"
if [ -n "${INSTALL_AUX_CLUSTER}" ] || [ -n "${INSTALL_MGMT_CLUSTER}" ]; then
echo "Setup CLI tools for mgmt and aux cluster"
- ./setup-cli-tools.sh
+ ./setup-cli-tools.sh || FATAL_TRACK mgmtcluster "setup-cli-tools.sh failed"
track mgmtcluster setupclitools_ok
echo "Creating folders under ${OSM_HOME_DIR} for credentials and repos"
# Test if the user exists. Otherwise, create a git user
echo "Test if there is a git user. Otherwise, create it."
- if [ -n "$(git config user.name)" ]; then
- git -C $WORK_REPOS_DIR config --local user.name osm_user
- git -C $WORK_REPOS_DIR config --local user.email osm_user@mydomain.com
+ if [ ! -n "$(git config user.name)" ]; then
+ git config --global user.name osm_user
+ git config --global user.email osm_user@mydomain.com
fi
# Test if the user exists. Otherwise, create a git user
fi
+set +x
+
# "aux-svc" cluster
if [ -n "${INSTALL_AUX_CLUSTER}" ]; then
echo "Provisioning auxiliary cluster with Gitea"
export KUBECONFIG="${KUBECONFIG_AUX_CLUSTER}"
- ./01-provision-aux-svc.sh
+ ./01-provision-aux-svc.sh || FATAL_TRACK mgmtcluster "provision-aux-svc.sh failed"
track mgmtcluster aux_cluster_ok
- ./02-provision-local-git-user.sh
+ ./02-provision-local-git-user.sh || FATAL_TRACK mgmtcluster "provision-local-git-user.sh failed"
track mgmtcluster local_git_user_ok
fi
if [ -n "${INSTALL_MGMT_CLUSTER}" ]; then
echo "Provisioning mgmt cluster"
export KUBECONFIG="${KUBECONFIG_MGMT_CLUSTER}"
- ./03-provision-mgmt-cluster.sh
+ ./03-provision-mgmt-cluster.sh || FATAL_TRACK mgmtcluster "provision-mgmt-cluster.sh failed"
track mgmtcluster mgmt_cluster_ok
fi
# limitations under the License.
#
+pushd $HOME
+
# Install `gnupg` and `gpg` - Typically pre-installed in Ubuntu
sudo apt-get install gnupg gpg
sudo apt-get install gettext-base
# Install `age`
-# Ubuntu 22.04+:
-sudo apt-get install age
+curl -LO https://github.com/FiloSottile/age/releases/download/v1.1.0/age-v1.1.0-linux-amd64.tar.gz
+tar xvfz age-v1.1.0-linux-amd64.tar.gz
+sudo mv age/age age/age-keygen /usr/local/bin/
+sudo chmod +x /usr/local/bin/age*
+rm -rf age age-v1.1.0-linux-amd64.tar.gz
# (Only for Gitea) Install `apg`
sudo apt-get install apg
# # (Only for Minio) `kubectl minio` plugin and Minio Client
-# curl https://github.com/minio/operator/releases/download/v5.0.12/kubectl-minio_5.0.12_linux_amd64 -Lo kubectl-minio
-# curl https://dl.min.io/client/mc/release/linux-amd64/mc -o minioc
-# chmod +x kubectl-minio minioc
-# sudo mv kubectl-minio minioc /usr/local/bin/
-# # (Only for HTTPS Ingress for Minio tenant) Install `openssl`
-# sudo apt-get install openssl
+if [ -n "${INSTALL_MINIO}" ]; then
+ curl https://github.com/minio/operator/releases/download/v5.0.12/kubectl-minio_5.0.12_linux_amd64 -Lo kubectl-minio
+ curl https://dl.min.io/client/mc/release/linux-amd64/mc -o minioc
+ chmod +x kubectl-minio minioc
+ sudo mv kubectl-minio minioc /usr/local/bin/
+ # (Only for HTTPS Ingress for Minio tenant) Install `openssl`
+ sudo apt-get install openssl
+fi
# Flux client
curl -s https://fluxcd.io/install.sh | sudo bash
# Autocompletion
. <(flux completion bash)
+
+# Kustomize
+KUSTOMIZE_VERSION="5.4.3"
+curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash -s -- ${KUSTOMIZE_VERSION}
+sudo install -o root -g root -m 0755 kustomize /usr/local/bin/kustomize
+rm kustomize
+
+# yq
+VERSION=v4.33.3
+BINARY=yq_linux_amd64
+curl -L https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY} -o yq
+sudo mv yq /usr/local/bin/yq
+sudo chmod +x /usr/local/bin/yq
+
+popd