Skip to content

Commit a00208d

Browse files
fix: add withCredentials to post-success for kubectl access
1 parent 623fafd commit a00208d

File tree

1 file changed

+25
-22
lines changed

1 file changed

+25
-22
lines changed

pmm/v3/pmm3-ha-eks.groovy

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Hook test - safe to delete
12
/**
23
* PMM HA EKS Test Pipeline
34
*
@@ -46,11 +47,11 @@ pipeline {
4647

4748
environment {
4849
CLUSTER_NAME = "pmm-ha-test-${BUILD_NUMBER}"
49-
REGION = "us-east-2"
50+
REGION = 'us-east-2'
5051
KUBECONFIG = "${WORKSPACE}/kubeconfig/config"
51-
PMM_NAMESPACE = "pmm"
52-
ACM_CERT_ARN = "arn:aws:acm:us-east-2:119175775298:certificate/9bd3a0c8-8205-4092-8003-7304ca762143"
53-
R53_ZONE_NAME = "cd.percona.com"
52+
PMM_NAMESPACE = 'pmm'
53+
ACM_CERT_ARN = 'arn:aws:acm:us-east-2:119175775298:certificate/9bd3a0c8-8205-4092-8003-7304ca762143'
54+
R53_ZONE_NAME = 'cd.percona.com'
5455
PMM_DOMAIN = "pmm-ha-test-${BUILD_NUMBER}.${R53_ZONE_NAME}"
5556
}
5657

@@ -356,24 +357,26 @@ EOF
356357

357358
post {
358359
success {
359-
script {
360-
def pmmPassword = sh(
361-
script: "kubectl get secret pmm-secret -n ${PMM_NAMESPACE} -o jsonpath='{.data.PMM_ADMIN_PASSWORD}' | base64 --decode",
362-
returnStdout: true
363-
).trim()
364-
365-
def chartRepo = sh(
366-
script: "cat .chart-repo-source 2>/dev/null || echo 'unknown'",
367-
returnStdout: true
368-
).trim()
369-
370-
currentBuild.description = "https://${PMM_DOMAIN} | admin / ${pmmPassword} | ${chartRepo}/${HELM_CHART_BRANCH}"
371-
372-
echo "Cluster ${CLUSTER_NAME} with PMM HA created successfully."
373-
echo "PMM URL: https://${PMM_DOMAIN}"
374-
echo "User: admin"
375-
echo "Password: ${pmmPassword}"
376-
echo "Chart: ${chartRepo}/${HELM_CHART_BRANCH}"
360+
withCredentials([aws(credentialsId: 'pmm-staging-slave')]) {
361+
script {
362+
def pmmPassword = sh(
363+
script: "kubectl get secret pmm-secret -n ${PMM_NAMESPACE} -o jsonpath='{.data.PMM_ADMIN_PASSWORD}' | base64 --decode",
364+
returnStdout: true
365+
).trim()
366+
367+
def chartRepo = sh(
368+
script: "cat .chart-repo-source 2>/dev/null || echo 'unknown'",
369+
returnStdout: true
370+
).trim()
371+
372+
currentBuild.description = "https://${PMM_DOMAIN} | admin / ${pmmPassword} | ${chartRepo}/${HELM_CHART_BRANCH}"
373+
374+
echo "Cluster ${CLUSTER_NAME} with PMM HA created successfully."
375+
echo "PMM URL: https://${PMM_DOMAIN}"
376+
echo 'User: admin'
377+
echo "Password: ${pmmPassword}"
378+
echo "Chart: ${chartRepo}/${HELM_CHART_BRANCH}"
379+
}
377380
}
378381
}
379382
failure {

0 commit comments

Comments
 (0)