# set -eux
K8S_CLOUD_NAME="k8s-cloud"
-
+IMAGES_OVERLAY_FILE=~/.osm/images-overlay.yaml
function check_arguments(){
while [ $# -gt 0 ] ; do
case $1 in
--controller) CONTROLLER="$2" ;;
--lxd-cloud) LXD_CLOUD="$2" ;;
--lxd-credentials) LXD_CREDENTIALS="$2" ;;
- --microstack) MICROSTACK=y
+ --microstack) MICROSTACK=y ;;
+ --tag) TAG="$2" ;;
esac
shift
done
if [ -v BUNDLE ]; then
juju deploy $BUNDLE --overlay ~/.osm/vca-overlay.yaml
else
- juju deploy osm --overlay ~/.osm/vca-overlay.yaml
+ images_overlay=""
+ [ -v TAG ] && generate_images_overlay && images_overlay="--overlay $IMAGES_OVERLAY_FILE"
+ juju deploy osm --overlay ~/.osm/vca-overlay.yaml $images_overlay
fi
echo "Waiting for deployment to finish..."
check_osm_deployed &> /dev/null
OSM_VCA_HOST=$vca_host
}
+function generate_images_overlay(){
+ cat << EOF > /tmp/images-overlay.yaml
+applications:
+ lcm-k8s:
+ options:
+ image: opensourcemano/lcm:$TAG
+ mon-k8s:
+ options:
+ image: opensourcemano/mon:$TAG
+ ro-k8s:
+ options:
+ image: opensourcemano/ro:$TAG
+ nbi-k8s:
+ options:
+ image: opensourcemano/nbi:$TAG
+ pol-k8s:
+ options:
+ image: opensourcemano/pol:$TAG
+ ui-k8s:
+ options:
+ image: opensourcemano/light-ui:$TAG
+
+EOF
+ mv /tmp/images-overlay.yaml $IMAGES_OVERLAY_FILE
+}
+
function install_osmclient() {
sudo snap install osmclient
sudo snap alias osmclient.osm osm
echo -e " --lxd-cloud <yaml path>: Takes a YAML file as a parameter with the LXD Cloud information (--charmed option)"
echo -e " --lxd-credentials <yaml path>: Takes a YAML file as a parameter with the LXD Credentials information (--charmed option)"
echo -e " --microstack: Installs microstack as a vim. (--charmed option)"
+ echo -e " --tag: Docker image tag"
}
[ "${OPTARG}" == "lxdendpoint" ] && continue
[ "${OPTARG}" == "lxdcert" ] && continue
[ "${OPTARG}" == "microstack" ] && continue
+ [ "${OPTARG}" == "tag" ] && continue
[ "${OPTARG}" == "pla" ] && INSTALL_PLA="y" && continue
echo -e "Invalid option: '--$OPTARG'\n" >&2
usage && exit 1