Skip to content

Commit

Permalink
Debugging rancher versions script
Browse files Browse the repository at this point in the history
  • Loading branch information
anupama2501 committed Nov 14, 2024
1 parent 29d71f6 commit 6adb0ce
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
11 changes: 10 additions & 1 deletion tests/v2/validation/pipeline/Jenkinsfile.release.upgrade.local
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,18 @@ node {
def configContents = env.CONFIG

def rancherK8sVersions = ""

echo "Printing the contents of the directory"

sh "ls -l"

sh "pwd"

echo "Before the start of script."

try{
rancherK8sVersions= sh (
script: "${workPath}pipeline/scripts/rancher_k8s_version.sh",
script: "./pipeline/scripts/rancher_k8s_version.sh",
returnStdout: true
)
} catch(err){
Expand Down
8 changes: 4 additions & 4 deletions tests/v2/validation/pipeline/scripts/rancher_k8s_version.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ latest_rancher_version=$(curl -s https://prime.ribs.rancher.io/index.html | grep
echo "Latest Rancher Version: $latest_rancher_version"

k8s_versions=$(curl -s "https://prime.ribs.rancher.io/rancher/${latest_rancher_version}/rancher-images.txt" | grep "rancher/hardened-kubernetes:" | awk -F':' '{print $2}' | awk -F '-build' '{print $1}' | sort -V | awk -F '.' '
{versions[$1"."$2] = $0} # Keep only the latest version for each major.minor
{versions[$1"."$2] = $0}
END {
for (v in versions) print versions[v]","
for (v in versions) print versions[v]""
}' | sort -V | tail -n 2)


# Output the results
echo "Latest Kubernetes Versions:"
echo "$k8s_versions"
echo "Latest Kubernetes Versions: "
echo "$k8s_versions"

0 comments on commit 6adb0ce

Please sign in to comment.