Update tag to be used by airflow image when installing NGSA 28/12728/1 release-v13.0-start
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 25 Nov 2022 16:21:46 +0000 (17:21 +0100)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 25 Nov 2022 16:21:56 +0000 (17:21 +0100)
Change-Id: I779139e1cb4cc62011e642b852d8c53a6ddea53e
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
installers/full_install_osm.sh
installers/install_ngsa.sh

index 1bed516..8b7f1d8 100755 (executable)
@@ -520,7 +520,7 @@ function deploy_osm_pla_service() {
 
 function install_osm_ngsa_service() {
     [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
-    $OSM_DEVOPS/installers/install_ngsa.sh -d ${OSM_HELM_WORK_DIR} -D ${OSM_DEVOPS} ${DEBUG_INSTALL} || \
+    $OSM_DEVOPS/installers/install_ngsa.sh -d ${OSM_HELM_WORK_DIR} -D ${OSM_DEVOPS} -t ${OSM_DOCKER_TAG} ${DEBUG_INSTALL} || \
     FATAL_TRACK install_osm_ngsa_service "install_ngsa.sh failed"
     [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
 }
index 6ddf298..5d7ad68 100755 (executable)
@@ -25,6 +25,9 @@ function install_airflow() {
     # copy airflow-values.yaml to the destination folder
     sudo mkdir -p ${OSM_HELM_WORK_DIR}
     sudo cp ${OSM_DEVOPS}/installers/helm/values/airflow-values.yaml ${OSM_HELM_WORK_DIR}
+    # update airflow-values.yaml to use the right tag
+    echo "Updating Helm values file helm/values/airflow-values.yaml to use defaultAirflowTag: ${OSM_DOCKER_TAG}"
+    sudo sed -i "s#defaultAirflowTag:.*#defaultAirflowTag: ${OSM_DOCKER_TAG}#g" ${OSM_HELM_WORK_DIR}/airflow-values.yaml
     if ! helm -n osm status airflow 2> /dev/null ; then
         # if it does not exist, create secrets and install
         kubectl -n osm create secret generic airflow-webserver-secret --from-literal="webserver-secret-key=$(python3 -c 'import secrets; print(secrets.token_hex(16))')"
@@ -56,7 +59,12 @@ function install_prometheus_pushgateway() {
 }
 
 # main
-while getopts ":D:d:-: " o; do
+
+OSM_DEVOPS="/usr/share/osm-devops"
+OSM_HELM_WORK_DIR="/etc/osm/helm"
+OSM_DOCKER_TAG="13"
+
+while getopts ":D:d:t:-: " o; do
     case "${o}" in
         D)
             OSM_DEVOPS="${OPTARG}"
@@ -64,6 +72,9 @@ while getopts ":D:d:-: " o; do
         d)
             OSM_HELM_WORK_DIR="${OPTARG}"
             ;;
+        t)
+            OSM_DOCKER_TAG="${OPTARG}"
+            ;;
         -)
             [ "${OPTARG}" == "debug" ] && DEBUG_INSTALL="y" && continue
             echo -e "Invalid option: '--$OPTARG'\n" >&2
@@ -88,6 +99,7 @@ source $OSM_DEVOPS/common/track
 
 echo "DEBUG_INSTALL=$DEBUG_INSTALL"
 echo "OSM_DEVOPS=$OSM_DEVOPS"
+echo "OSM_DOCKER_TAG=$OSM_DOCKER_TAG"
 echo "OSM_HELM_WORK_DIR=$OSM_HELM_WORK_DIR"
 
 install_airflow