Skip to content

Commit

Permalink
CLOUD-855 Set currentBuild.description automatically - PG (#2893)
Browse files Browse the repository at this point in the history
* CLOUD-855 Set currentBuild.description automatically

* revert changes, because we wouldl execute prepareSources step for 5 times in this case: on stage 'Prepare node' and on each 'clusterX' stage.
  • Loading branch information
ptankov authored Sep 25, 2024
1 parent d17be91 commit 419bedc
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 12 deletions.
7 changes: 4 additions & 3 deletions cloud/jenkins/pgo_operator_aws_openshift-4.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ void prepareNode() {
kubectl krew install --manifest-url https://raw.githubusercontent.com/kubernetes-sigs/krew-index/336ef83542fd2f783bfa2c075b24599e834dcc77/plugins/kuttl.yaml
echo \$(kubectl kuttl --version) is installed
"""
}

void prepareSources() {
if ("$PGO_POSTGRES_IMAGE") {
currentBuild.description = "$GIT_BRANCH-$PLATFORM_VER-CW_$CLUSTER_WIDE-" + "$PGO_POSTGRES_IMAGE".split(":")[1]
}

if ("$PLATFORM_VER" == "latest") {
USED_PLATFORM_VER = sh(script: "curl -s https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/$PLATFORM_VER/release.txt | sed -n 's/^\\s*Version:\\s\\+\\(\\S\\+\\)\\s*\$/\\1/p'", , returnStdout: true).trim()
} else {
Expand Down Expand Up @@ -410,7 +412,6 @@ pipeline {
stage('Prepare node') {
steps {
prepareNode()
prepareSources()
}
}
stage('Docker Build and Push') {
Expand Down
7 changes: 4 additions & 3 deletions cloud/jenkins/pgo_operator_aws_openshift_latest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ void prepareNode() {
kubectl krew install --manifest-url https://raw.githubusercontent.com/kubernetes-sigs/krew-index/336ef83542fd2f783bfa2c075b24599e834dcc77/plugins/kuttl.yaml
echo \$(kubectl kuttl --version) is installed
"""
}

void prepareSources() {
if ("$PGO_POSTGRES_IMAGE") {
currentBuild.description = "$GIT_BRANCH-$PLATFORM_VER-CW_$CLUSTER_WIDE-" + "$PGO_POSTGRES_IMAGE".split(":")[1]
}

if ("$PLATFORM_VER" == "latest") {
USED_PLATFORM_VER = sh(script: "curl -s https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/$PLATFORM_VER/release.txt | sed -n 's/^\\s*Version:\\s\\+\\(\\S\\+\\)\\s*\$/\\1/p'", , returnStdout: true).trim()
} else {
Expand Down Expand Up @@ -410,7 +412,6 @@ pipeline {
stage('Prepare node') {
steps {
prepareNode()
prepareSources()
}
}
stage('Docker Build and Push') {
Expand Down
4 changes: 4 additions & 0 deletions cloud/jenkins/pgo_operator_eks_latest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ void prepareNode() {
curl -sL https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_\$(uname -s)_amd64.tar.gz | sudo tar -C /usr/local/bin -xzf - && sudo chmod +x /usr/local/bin/eksctl
"""

if ("$PGO_POSTGRES_IMAGE") {
currentBuild.description = "$GIT_BRANCH-$PLATFORM_VER-CW_$CLUSTER_WIDE-" + "$PGO_POSTGRES_IMAGE".split(":")[1]
}

if ("$PLATFORM_VER" == "latest") {
USED_PLATFORM_VER = sh(script: "eksctl version -ojson | jq -r '.EKSServerSupportedVersions | max'", , returnStdout: true).trim()
} else {
Expand Down
4 changes: 4 additions & 0 deletions cloud/jenkins/pgo_operator_eks_version.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ void prepareNode() {
curl -sL https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_\$(uname -s)_amd64.tar.gz | sudo tar -C /usr/local/bin -xzf - && sudo chmod +x /usr/local/bin/eksctl
"""

if ("$PGO_POSTGRES_IMAGE") {
currentBuild.description = "$GIT_BRANCH-$PLATFORM_VER-CW_$CLUSTER_WIDE-" + "$PGO_POSTGRES_IMAGE".split(":")[1]
}

if ("$PLATFORM_VER" == "latest") {
USED_PLATFORM_VER = sh(script: "eksctl version -ojson | jq -r '.EKSServerSupportedVersions | max'", , returnStdout: true).trim()
} else {
Expand Down
7 changes: 4 additions & 3 deletions cloud/jenkins/pgo_operator_gke_latest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ EOF
gcloud config set project $GCP_PROJECT
"""
}
}

void prepareSources() {
if ("$PGO_POSTGRES_IMAGE") {
currentBuild.description = "$GIT_BRANCH-$PLATFORM_VER-CW_$CLUSTER_WIDE-" + "$PGO_POSTGRES_IMAGE".split(":")[1]
}

if ("$PLATFORM_VER" == "latest") {
USED_PLATFORM_VER = sh(script: "gcloud container get-server-config --region=$region --flatten=channels --filter='channels.channel=RAPID' --format='value(channels.defaultVersion)' | cut -d '.' -f 1,2", , returnStdout: true).trim()
} else {
Expand Down Expand Up @@ -368,7 +370,6 @@ pipeline {
stage('Prepare node') {
steps {
prepareNode()
prepareSources()
}
}
stage('Docker Build and Push') {
Expand Down
7 changes: 4 additions & 3 deletions cloud/jenkins/pgo_operator_gke_version.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ EOF
gcloud config set project $GCP_PROJECT
"""
}
}

void prepareSources() {
if ("$PGO_POSTGRES_IMAGE") {
currentBuild.description = "$GIT_BRANCH-$PLATFORM_VER-CW_$CLUSTER_WIDE-" + "$PGO_POSTGRES_IMAGE".split(":")[1]
}

if ("$PLATFORM_VER" == "latest") {
USED_PLATFORM_VER = sh(script: "gcloud container get-server-config --region=$region --flatten=channels --filter='channels.channel=RAPID' --format='value(channels.defaultVersion)' | cut -d '.' -f 1,2", , returnStdout: true).trim()
} else {
Expand Down Expand Up @@ -373,7 +375,6 @@ pipeline {
stage('Prepare node') {
steps {
prepareNode()
prepareSources()
}
}
stage('Docker Build and Push') {
Expand Down

0 comments on commit 419bedc

Please sign in to comment.