Skip to content

Commit 89a6868

Browse files
authored
Update jenkinsfile
1 parent 9dc3bd2 commit 89a6868

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

jenkinsfile

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,17 @@ pipeline {
4444
}
4545
stage('Deploying to Kubernetes') {
4646
steps{
47-
sshagent(['k8s']) {
48-
sh "scp -o strictHostKeyChecking=no app.yaml [email protected]:/home/ubuntu"
49-
script {
50-
try{
51-
sh "ssh [email protected] kubectl apply -f ."
52-
}catch(error){
53-
sh "ssh [email protected] kubectl create -f ."
54-
}
47+
withKubeConfig([credentialsId: 'kuber', serverUrl: 'https://172.31.33.161:6443']) {
48+
49+
sh "kubectl apply -f app.yaml -n dev"
50+
51+
}
5552

56-
}
53+
}
5754

5855

59-
}
60-
}
61-
}
56+
}
57+
58+
6259
}
6360
}

0 commit comments

Comments
 (0)