From b1a2d3add02659b11eb23f383d7e70811b1d1957 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Sat, 28 Dec 2019 12:06:50 -0500 Subject: [PATCH] ci: Try new kubernetes deployment --- Jenkinsfile | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bd4c7c3..efa818c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent { - label 'nodejs && docker' + label 'nodejs && docker && kubectl' } stages { @@ -59,12 +59,14 @@ pipeline { } steps { script { - sshagent(['jenkins.ssh']) { - sh 'ssh docker.tanndev.com rm -rf maelstrom' - sh 'ssh docker.tanndev.com mkdir maelstrom' - sh 'scp docker-compose.yml docker.tanndev.com:maelstrom/' - sh 'ssh docker.tanndev.com "cd maelstrom && docker-compose pull"' - sh 'ssh docker.tanndev.com "cd maelstrom && docker-compose up -d"' + // Deploy the app. + withKubeConfig([ + credentialsId: 'microservices-kubernetes-token', + serverUrl: "$MICROSERVICES_KUBERNETES_SERVER", + namespace: 'maelstrom' + ]) { + sh 'kubectl apply -f manifest.yaml' + sh 'kubectl rollout restart deployment/maelstrom' } if (RELEASE_VERSION) {