This repository has been archived by the owner on May 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
313 changed files
with
23,981 additions
and
5,001 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
BUILD_BASE_IMAGE_NAME=emco-service-build-base | ||
BUILD_BASE_IMAGE_VERSION=:1.1 | ||
BUILD_BASE_IMAGE_VERSION=:1.2 | ||
SERVICE_BASE_IMAGE_NAME=alpine | ||
SERVICE_BASE_IMAGE_VERSION=:3.12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
#!/bin/sh | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright (c) 2021 Intel Corporation | ||
#-------- DO NOT EDIT THIS FILE ---------# | ||
usage() { | ||
echo "USAGE:" $0 "<optional: -s parameter=value> <optional: -k <path to kubeconfig file>> <optional: -p [enable | disable]> [install | uninstall]" | ||
echo "NOTES: multiple instances of <-s parameter=value> may be provided" | ||
echo "NOTES: -p [enable | disable] enable or disable mongo and etcd persistance, default is disable" | ||
} | ||
|
||
EMCO_DB_HELM_FILE="emco-db-0.1.0.tgz" | ||
EMCO_SERVICES_HELM_FILE="emco-services-0.1.0.tgz" | ||
EMCO_TOOLS_HELM_FILE="emco-tools-0.1.0.tgz" | ||
|
||
# Default is to override etcd and mongo persistence to be disabled | ||
PERSISTENCE="--set etcd.persistence.enabled=false --set mongo.persistence.enabled=false" | ||
|
||
cleanup() { | ||
echo "Uninstalling emco" | ||
helm ${KUBCFG} uninstall --namespace=emco emco-db | ||
helm ${KUBCFG} uninstall --namespace=emco emco-services | ||
helm ${KUBCFG} uninstall --namespace=emco emco-tools | ||
|
||
echo "Deleting namespace emco" | ||
kubectl ${KUBCFG} delete ns emco | ||
} | ||
|
||
# convert databause authentication parameters in old format to new format | ||
globalize_dbauth_values() { | ||
HELMSETVALUES=`echo ${HELMSETVALUES} | sed -e '\ | ||
s/--set enableDbAuth=true/--set global.disableDbAuth=false/;\ | ||
s/--set enableDbAuth=false/--set global.disableDbAuth=true/;\ | ||
s/--set db.rootPassword/--set global.db.rootPassword/;\ | ||
s/--set db.emcoPassword/--set global.db.emcoPassword/;\ | ||
s/--set contextdb.rootPassword/--set global.contextdb.rootPassword/;\ | ||
s/--set contextdb.emcoPassword/--set global.contextdb.emcoPassword/;'` | ||
} | ||
|
||
install() { | ||
echo "Creating namespace emco" | ||
kubectl ${KUBCFG} create ns emco | ||
echo "Installing EMCO DB. Please wait..." | ||
helm ${KUBCFG} install --namespace=emco -f helm_value_overrides.yaml ${HELMSETVALUES} ${PERSISTENCE} --wait emco-db ${EMCO_DB_HELM_FILE} | ||
if [ "$?" -ne "0" ]; then | ||
cleanup | ||
exit 1 | ||
fi | ||
echo "Done" | ||
echo "Installing EMCO Services. Please wait..." | ||
helm ${KUBCFG} install --namespace=emco -f helm_value_overrides.yaml ${HELMSETVALUES} --wait emco-services ${EMCO_SERVICES_HELM_FILE} | ||
if [ "$?" -ne "0" ]; then | ||
cleanup | ||
exit 1 | ||
fi | ||
echo "Done" | ||
echo "Installing EMCO Tools. Please wait..." | ||
helm ${KUBCFG} install --namespace=emco -f helm_value_overrides.yaml ${HELMSETVALUES} --wait emco-tools ${EMCO_TOOLS_HELM_FILE} | ||
if [ "$?" -ne "0" ]; then | ||
cleanup | ||
exit 1 | ||
fi | ||
echo "Done" | ||
} | ||
|
||
uninstall() { | ||
echo "Removing EMCO..." | ||
cleanup | ||
echo "Done" | ||
} | ||
|
||
KUBCFG="" | ||
HELMSETVALUES="" | ||
while getopts "hs:k:p:" opt; do | ||
case $opt in | ||
s) | ||
HELMSETVALUES=${HELMSETVALUES}" --set $OPTARG" | ||
;; | ||
k) | ||
KUBCFG="--kubeconfig="$OPTARG | ||
;; | ||
h) | ||
usage | ||
exit 0 | ||
;; | ||
p) | ||
if [ "$OPTARG" = "enable" ]; then | ||
PERSISTENCE="--set etcd.persistence.enabled=true --set mongo.persistence.enabled=true" | ||
elif [ "$OPTARG" = "disable" ]; then | ||
PERSISTENCE="--set etcd.persistence.enabled=false --set mongo.persistence.enabled=false" | ||
else | ||
echo "Invalid persistence option: -p $OPTARG" >&2 | ||
usage | ||
exit 1 | ||
fi | ||
;; | ||
\?) | ||
echo "Invalid option: -$OPTARG" >&2 | ||
usage | ||
exit 1 | ||
;; | ||
:) | ||
echo "Option -$OPTARG requires an argument." >&2 | ||
usage | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
shift $((OPTIND -1)) | ||
|
||
if [ "$1" = "install" ]; then | ||
globalize_dbauth_values | ||
install | ||
elif [ "$1" = "uninstall" ]; then | ||
uninstall | ||
else | ||
echo "Not a valid command: "$2 | ||
exit 2 | ||
fi | ||
exit 0 |
Oops, something went wrong.