Feature 11077: update installer to remove osm-devops deb package installation 48/15548/5
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Thu, 27 Nov 2025 09:32:37 +0000 (10:32 +0100)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 5 Dec 2025 13:44:39 +0000 (14:44 +0100)
Change-Id: I85ff7554de78ce96e3b3ee844cab8b7541cded81
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
installers/00-default-install-options.rc
installers/01-export-osm-install-options.sh
installers/full_install_osm.sh
installers/install_osm.sh
jenkins/ci-pipelines/ci_stage_3.groovy
jenkins/public-clouds-tests/Jenkinsfile

index 6159a52..4b057ca 100644 (file)
@@ -20,9 +20,6 @@ export APT_PROXY_URL=""
 export K8S_CLUSTER_ENGINE="k3s"
 export DEBUG_INSTALL=""
 export RELEASE="testing-daily"
-export REPOSITORY="testing"
-export REPOSITORY_KEY="OSM%20ETSI%20Release%20Key.gpg"
-export REPOSITORY_BASE="https://osm-download.etsi.org/repository/osm/debian"
 export INSTALL_AUX_CLUSTER="y"
 export INSTALL_MGMT_CLUSTER="y"
 export OSM_NAMESPACE=osm
index a69eb64..069a446 100755 (executable)
@@ -36,9 +36,6 @@ export APT_PROXY_URL=${APT_PROXY_URL}
 export K8S_CLUSTER_ENGINE=${K8S_CLUSTER_ENGINE}
 export DEBUG_INSTALL=${DEBUG_INSTALL}
 export RELEASE=${RELEASE}
-export REPOSITORY=${REPOSITORY}
-export REPOSITORY_KEY=${REPOSITORY_KEY}
-export REPOSITORY_BASE=${REPOSITORY_BASE}
 export INSTALL_AUX_CLUSTER=${INSTALL_AUX_CLUSTER}
 export INSTALL_MGMT_CLUSTER=${INSTALL_MGMT_CLUSTER}
 export OSM_NAMESPACE=${OSM_NAMESPACE}
index 589fffa..e9a0611 100755 (executable)
@@ -20,10 +20,7 @@ function usage(){
     echo -e "  OPTIONS"
     echo -e "     -h / --help:    print this help"
     echo -e "     -y:             do not prompt for confirmation, assumes yes"
-    echo -e "     -r <repo>:      use specified repository name for osm packages"
-    echo -e "     -R <release>:   use specified release for osm binaries (deb packages, ...)"
-    echo -e "     -u <repo base>: use specified repository url for osm packages"
-    echo -e "     -k <repo key>:  use specified repository public key url"
+    echo -e "     -S <gerrit refspec>: use a specific devops gerrit refspec (branch, tag, commit), default is master"
     echo -e "     -a <apt proxy url>: use this apt proxy url when downloading apt packages (air-gapped installation)"
     echo -e "     -c <kubernetes engine>: use a specific kubernetes engine (options: kubeadm, k3s), default is kubeadm"
     echo -e "     -t <docker tag> specify osm docker tag (default is latest)"
@@ -52,8 +49,11 @@ echo "Load default options and export user installation options"
 source $OSM_DEVOPS/installers/00-default-install-options.rc
 
 RE_CHECK='^[a-z0-9]([-a-z0-9]*[a-z0-9])?$'
-while getopts ":a:c:e:r:k:u:R:D:s:t:U:d:p:m:T:M:G:O:-: hy" o; do
+while getopts ":a:c:e:S:D:s:t:U:d:p:m:T:M:G:O:-: hy" o; do
     case "${o}" in
+        S)
+            DEVOPS_GERRIT_REFSPEC="${OPTARG}"
+            ;;
         a)
             APT_PROXY_URL=${OPTARG}
             ;;
@@ -67,22 +67,6 @@ while getopts ":a:c:e:r:k:u:R:D:s:t:U:d:p:m:T:M:G:O:-: hy" o; do
         e)
             OSM_K8S_EXTERNAL_IP="${OPTARG}"
             ;;
-        r)
-            REPOSITORY="${OPTARG}"
-            REPO_ARGS+=(-r "$REPOSITORY")
-            ;;
-        k)
-            REPOSITORY_KEY="${OPTARG}"
-            REPO_ARGS+=(-k "$REPOSITORY_KEY")
-            ;;
-        u)
-            REPOSITORY_BASE="${OPTARG}"
-            REPO_ARGS+=(-u "$REPOSITORY_BASE")
-            ;;
-        R)
-            RELEASE="${OPTARG}"
-            REPO_ARGS+=(-R "$RELEASE")
-            ;;
         D)
             OSM_DEVOPS="${OPTARG}"
             ;;
index a70b05e..03559a7 100755 (executable)
 #   See the License for the specific language governing permissions and
 #   limitations under the License.
 #
-REPOSITORY_BASE=https://osm-download.etsi.org/repository/osm/debian
-RELEASE=ReleaseEIGHTEEN
-REPOSITORY=stable
+
+DEVOPS_GERRIT_REFSPEC="master"
 DOCKER_TAG="testing-daily"
-DEVOPS_PATH=/usr/share/osm-devops
 
 function usage(){
     [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
@@ -25,10 +23,7 @@ function usage(){
     echo -e "  OPTIONS"
     echo -e "     -h / --help:    print this help"
     echo -e "     -y:             do not prompt for confirmation, assumes yes"
-    echo -e "     -r <repo>:      use specified repository name for osm packages"
-    echo -e "     -R <release>:   use specified release for osm binaries (deb packages, ...)"
-    echo -e "     -u <repo base>: use specified repository url for osm packages"
-    echo -e "     -k <repo key>:  use specified repository public key url"
+    echo -e "     -S <gerrit refspec>: use a specific devops gerrit refspec (branch, tag, commit), default is master"
     echo -e "     -a <apt proxy url>: use this apt proxy url when downloading apt packages (air-gapped installation)"
     echo -e "     -c <kubernetes engine>: use a specific kubernetes engine (options: kubeadm, k3s), default is kubeadm"
     echo -e "     -t <docker tag> specify osm docker tag (default is latest)"
@@ -49,43 +44,6 @@ function usage(){
     [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
 }
 
-add_repo() {
-  REPO_CHECK="^$1"
-  grep "${REPO_CHECK/\[arch=amd64\]/\\[arch=amd64\\]}" /etc/apt/sources.list > /dev/null 2>&1
-  if [ $? -ne 0 ]
-  then
-    need_packages_lw="software-properties-common apt-transport-https"
-    echo -e "Checking required packages to add ETSI OSM debian repo: $need_packages_lw"
-    dpkg -l $need_packages_lw &>/dev/null \
-      || ! echo -e "One or several required packages are not installed. Updating apt cache requires root privileges." \
-      || sudo apt-get -qy update \
-      || ! echo "failed to run apt-get update" \
-      || exit 1
-    dpkg -l $need_packages_lw &>/dev/null \
-      || ! echo -e "Installing $need_packages_lw requires root privileges." \
-      || sudo apt-get install -y $need_packages_lw \
-      || ! echo "failed to install $need_packages_lw" \
-      || exit 1
-    curl -s -o OSM-ETSI-Release-key.gpg "$REPOSITORY_BASE/$RELEASE/OSM%20ETSI%20Release%20Key.gpg"
-    sudo APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add OSM-ETSI-Release-key.gpg \
-      || ! echo -e "Could not add GPG key $REPOSITORY_BASE/$RELEASE/OSM%20ETSI%20Release%20Key.gpg" \
-      || exit 1
-    sudo DEBIAN_FRONTEND=noninteractive add-apt-repository -y "$1"
-    sudo DEBIAN_FRONTEND=noninteractive apt-get -y update
-    return 0
-  fi
-
-  return 1
-}
-
-clean_old_repo() {
-dpkg -s 'osm-devops' &> /dev/null
-if [ $? -eq 0 ]; then
-  # Clean the previous repos that might exist
-  sudo sed -i "/osm-download.etsi.org/d" /etc/apt/sources.list
-fi
-}
-
 function configure_apt_proxy() {
     [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
     OSM_APT_PROXY=$1
@@ -102,19 +60,10 @@ EOF"
     [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
 }
 
-while getopts ":a:c:e:r:k:u:R:D:s:t:U:d:p:m:T:M:G:O:-: hy" o; do
+while getopts ":a:c:e:S:D:s:t:U:d:p:m:T:M:G:O:-: hy" o; do
     case "${o}" in
-        D)
-            DEVOPS_PATH="${OPTARG}"
-            ;;
-        r)
-            REPOSITORY="${OPTARG}"
-            ;;
-        R)
-            RELEASE="${OPTARG}"
-            ;;
-        u)
-            REPOSITORY_BASE="${OPTARG}"
+        S)
+            DEVOPS_GERRIT_REFSPEC="${OPTARG}"
             ;;
         t)
             DOCKER_TAG="${OPTARG}"
@@ -138,8 +87,9 @@ while getopts ":a:c:e:r:k:u:R:D:s:t:U:d:p:m:T:M:G:O:-: hy" o; do
     esac
 done
 
-clean_old_repo
-add_repo "deb [arch=amd64] $REPOSITORY_BASE/$RELEASE $REPOSITORY devops"
 sudo DEBIAN_FRONTEND=noninteractive apt-get -qy update
-sudo DEBIAN_FRONTEND=noninteractive apt-get -y install osm-devops
-$DEVOPS_PATH/installers/full_install_osm.sh -R $RELEASE -r $REPOSITORY -u $REPOSITORY_BASE -D $DEVOPS_PATH -t $DOCKER_TAG "$@"
+sudo DEBIAN_FRONTEND=noninteractive apt-get -y install git
+DEVOPS_PATH=$(mktemp -d /tmp/osm-devops-XXXXXX)
+git clone https://osm.etsi.org/gerrit/osm/devops.git $DEVOPS_PATH
+git -C $DEVOPS_PATH checkout $DEVOPS_GERRIT_REFSPEC
+$DEVOPS_PATH/installers/full_install_osm.sh -t $DOCKER_TAG "$@"
index 7bb9c0c..411fc79 100644 (file)
@@ -960,24 +960,6 @@ node("${params.NODE}") {
                     repo_key_name = ''
                     release = ''
 
-                    if (params.COMMIT_ID) {
-                        commit_id = "-b ${params.COMMIT_ID}"
-                    }
-                    if (params.REPO_DISTRO) {
-                        repo_distro = "-r ${params.REPO_DISTRO}"
-                    }
-                    if (params.REPO_KEY_NAME) {
-                        repo_key_name = "-k ${params.REPO_KEY_NAME}"
-                    }
-                    if (params.RELEASE) {
-                        release = "-R ${params.RELEASE}"
-                    }
-                    if (params.REPOSITORY_BASE) {
-                        repo_base_url = "-u ${params.REPOSITORY_BASE}"
-                    } else {
-                        repo_base_url = "-u http://${NODE_IP_ADDRESS}:${repo_port}"
-                    }
-
                     remote = [
                         name: containerName,
                         host: IP_ADDRESS,
@@ -989,7 +971,7 @@ node("${params.NODE}") {
                     ]
 
                     sshCommand remote: remote, command: '''
-                        wget https://osm-download.etsi.org/ftp/osm-18.0-eighteen/install_osm.sh
+                        wget https://osm-download.etsi.org/ftp/osm-19.0-nineteen/install_osm.sh
                         chmod +x ./install_osm.sh
                         sed -i '1 i\\export PATH=/snap/bin:\$PATH' ~/.bashrc
                     '''
@@ -1011,10 +993,6 @@ node("${params.NODE}") {
                         withCredentials([gitlabCredentialsMap]) {
                             sshCommand remote: remote, command: """
                                 ./install_osm.sh -y \
-                                    ${repo_base_url} \
-                                    ${repo_key_name} \
-                                    ${release} -r unstable \
-                                    --charmed  \
                                     --registry ${USERNAME}:${PASSWORD}@${INTERNAL_DOCKER_REGISTRY} \
                                     --tag ${containerName}
                             """
@@ -1034,9 +1012,6 @@ node("${params.NODE}") {
                         withCredentials([gitlabCredentialsMap]) {
                             sshCommand remote: remote, command: """
                                 ./install_osm.sh -y \
-                                    ${repo_base_url} \
-                                    ${repo_key_name} \
-                                    ${release} -r unstable \
                                     -d ${USERNAME}:${PASSWORD}@${INTERNAL_DOCKER_REGISTRY} \
                                     -p ${INTERNAL_DOCKER_PROXY} \
                                     -t ${containerName} \
index 5739d08..caea6df 100644 (file)
@@ -21,7 +21,7 @@ pipeline {
 
         // Parameters to define the specific OSM version to test
         // --> Defaults to latest stable version of Release FOURTEEN
-        string(defaultValue: 'https://osm-download.etsi.org/ftp/osm-18.0-eighteen/install_osm.sh', description: 'URL to OSM installer', name: 'INSTALLER_URL')
+        string(defaultValue: 'https://osm-download.etsi.org/ftp/osm-19.0-nineteen/install_osm.sh', description: 'URL to OSM installer', name: 'INSTALLER_URL')
         string(defaultValue: 'testing-daily', description: 'Release for OSM binaries (REPO_BASE)', name: 'REPO_BASE')
         string(defaultValue: 'testing-daily', description: 'OSM docker tag (DOCKER_TAG)', name: 'DOCKER_TAG')
         string(defaultValue: 'testing', description: 'Repository name for OSM packages (REPO_NAME)', name: 'REPO_NAME')