From c9f15598c44ae4ae444d8ecb1b549e5aaf4177c9 Mon Sep 17 00:00:00 2001 From: Jan Rabcan Date: Wed, 20 Oct 2021 04:14:51 +0200 Subject: [PATCH] t. --- Jenkinsfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7bbc1f5..138fa83 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -34,6 +34,8 @@ pipeline { steps { sh "docker login https://registry.proxyq.co -u ${REGISTRY_CREDENTIALS_USR} --password ${REGISTRY_CREDENTIALS_PSW}" sh "docker push registry.proxyq.co/jenkins/website:${env.BUILD_ID}" + sh "docker tag registry.proxyq.co/jenkins/website:${env.BUILD_ID} registry.proxyq.co/jenkins/website:latest" + sh "docker push registry.proxyq.co/jenkins/website:latest" } } stage('Redeploy') { @@ -46,7 +48,13 @@ pipeline { def jwtObject = new groovy.json.JsonSlurper().parseText(jwtResponse.getContent()) env.JWTTOKEN = "Bearer ${jwtObject.jwt}" } - echo "${env.JWTTOKEN}" + script { + def json = """ + + """ + def response = httpRequest acceptType: 'APPLICATION_JSON', contentType: 'APPLICATION_JSON', validResponseCodes: '200', httpMode: 'POST', ignoreSslErrors: true, consoleLogResponseBody: true, requestBody: json, customHeaders: [[Authorization: "${env.JWTTOKEN}"]], url: "http://192.168.4.8:9000/api/endpoints/26/docker/containers/145772505f27bcdef1fbd807ecbb7b4ccbe6fb86dbb3a2bd0e22951557a15a10/stop" + new groovy.json.JsonSlurper().parseText(jwtResponse.getContent()) + } } } }