Files
openairinterface5g/ci-scripts/scripts/oc-chart-deploy.sh
Jaroslava Fiedlerova c02c3daad9 CI: Make a generic function for (un)deployment with script
Add simple unit tests for the new functions.

Signed-off-by: Jaroslava Fiedlerova <jaroslava.fiedlerova@openairinterface.org>
2026-05-29 12:54:51 +02:00

23 lines
600 B
Bash
Executable File

#!/bin/bash
# SPDX-License-Identifier: MIT
export PS4='[\D{%Y-%m-%d %H:%M:%S}] '
function die() { echo $@; exit 1; }
[ $# -eq 3 ] || die "usage: $0 <path-to-dir> <namespace> <image-tag>"
OC_NS=${2}
IMAGE_TAG=${3}
OC_DIR=${1}
OC_RELEASE=$(basename "${1}")
cat /opt/oc-password | oc login -u oaicicd --server https://api.oai.cs.eurecom.fr:6443 > /dev/null
oc project ${OC_NS} > /dev/null
set -x
helm install --wait --timeout 120s ${OC_RELEASE} --set nfimage.version=${IMAGE_TAG} --hide-notes ${OC_DIR}/.
status=$?
set +x
oc logout > /dev/null
[ $status -eq 0 ] || die "OC chart deployment failed"