From d66b01a134ab76219dd002e64f3e6cc3fea27502 Mon Sep 17 00:00:00 2001 From: Megha Mehta <76773785+mm2020-ind@users.noreply.github.com> Date: Fri, 12 Mar 2021 15:51:58 +0530 Subject: [PATCH] add creds --- Jenkinsfile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1a87c76..f91016f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,16 +1,14 @@ node { stage('Start argocd') { withKubeConfig(credentialsId: 'aws-eksctl-kubeconfig', serverUrl: '') { - // sh 'kubectl get all' + withCredentials([usernamePassword(credentialsId: 'argocd-devops-lab', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) { + sh""" kubectl port-forward svc/argocd-server -n argocd 8080:443& - - withCredentials([usernamePassword(credentialsId: 'argocd-devops-lab', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) { - sh 'argocd login 127.0.0.1:8080 --insecure --username $USERNAME --password $PASSWORD' - } - + sh 'argocd login 127.0.0.1:8080 --insecure --username $USERNAME --password $PASSWORD' argocd app list """ + } } }