Feature 8583

This feature will enable the installation of OSM with
charms on top of Kubernetes (microk8s by default).

Instructions to test this before Merge:

Change path to local full_install_osm.sh in
line 145 in install_osm.sh

Change path to local charmed_install.sh and
charmed_uninstall.sh in line 1285 and 1287 in
full_install_osm.sh

Afterwards, just execute:
./install_osm.sh --charmed

For uninstall
./install_osm.sh --uninstall

Change-Id: I6dfe0831ea5e2c265a365b41638e807106076346
Signed-off-by: Dominik Fleischmann <dominik.fleischmann@canonical.com>
diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh
index 9e4132c..72f3190 100755
--- a/installers/full_install_osm.sh
+++ b/installers/full_install_osm.sh
@@ -56,6 +56,13 @@
     echo -e "     --showopts:     print chosen options and exit (only for debugging)"
     echo -e "     -y:             do not prompt for confirmation, assumes yes"
     echo -e "     -h / --help:    print this help"
+    echo -e "     --charmed:                       install OSM with charms"
+    echo -e "     --bundle <bundle path>:          Specify with which bundle to deploy OSM with charms (--charmed option)"
+    echo -e "     --kubeconfig <kubeconfig path>:  Specify with which kubernetes to deploy OSM with charms (--charmed option)"
+    echo -e "     --lxdendpoint <lxd endpoint ip>: Specify with which LXD to deploy OSM with charms (--charmed option)"
+    echo -e "     --lxdcert <lxd cert path>:       Specify external LXD cert to deploy OSM with charms (--charmed option)"
+    echo -e "     --microstack:                    Installs microstack as a vim. (--charmed option)"
+
 }
 
 # takes a juju/accounts.yaml file and returns the password specific
@@ -1237,6 +1244,12 @@
             [ "${OPTARG}" == "nohostclient" ] && INSTALL_NOHOSTCLIENT="y" && continue
             [ "${OPTARG}" == "pullimages" ] && continue
             [ "${OPTARG}" == "k8s_monitor" ] && INSTALL_K8S_MONITOR="y" && continue
+            [ "${OPTARG}" == "charmed" ] && CHARMED="y" && continue
+            [ "${OPTARG}" == "bundle" ] && continue
+            [ "${OPTARG}" == "kubeconfig" ] && continue
+            [ "${OPTARG}" == "lxdendpoint" ] && continue
+            [ "${OPTARG}" == "lxdcert" ] && continue
+            [ "${OPTARG}" == "microstack" ] && continue
             echo -e "Invalid option: '--$OPTARG'\n" >&2
             usage && exit 1
             ;;
@@ -1267,6 +1280,32 @@
     exit 0
 fi
 
+if [ -n "$CHARMED" ]; then
+     if [ -n "$UNINSTALL" ]; then
+        /usr/share/osm-devops/installers/charmed_uninstall.sh -R $RELEASE -r $REPOSITORY -u $REPOSITORY_BASE -D /usr/share/osm-devops -t $DOCKER_TAG "$@"
+     else
+        /usr/share/osm-devops/installers/charmed_install.sh -R $RELEASE -r $REPOSITORY -u $REPOSITORY_BASE -D /usr/share/osm-devops -t $DOCKER_TAG "$@"
+     fi
+
+     echo "Your installation is now complete, follow these steps for configuring the osmclient:"
+     echo
+     echo "1. Get the NBI IP with the following command:"
+     echo
+     echo "juju status --format yaml | yq r - applications.nbi-k8s.address"
+     echo
+     echo "2. Create the OSM_HOSTNAME environment variable with the NBI IP"
+     echo
+     echo "export OSM_HOSTNAME=<NBI-IP>"
+     echo
+     echo "3. Add the previous command to your .bashrc for other Shell sessions"
+     echo
+     echo "export OSM_HOSTNAME=<previous-IP> >> ~/.bashrc"
+     echo
+     echo "DONE"
+
+     exit 0
+fi
+
 # if develop, we force master
 [ -z "$COMMIT_ID" ] && [ -n "$DEVELOP" ] && COMMIT_ID="master"
 
@@ -1340,3 +1379,4 @@
 wget -q -O- https://osm-download.etsi.org/ftp/osm-7.0-seven/README2.txt &> /dev/null
 track end
 echo -e "\nDONE"
+