From de303fcd8eeb3b435b9939fb40c2a4b73446168e Mon Sep 17 00:00:00 2001 From: L_DelOff Date: Tue, 21 Nov 2023 13:47:06 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BE=D1=87=D0=B8=D1=81=D1=82=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=BE=D1=82=20=D0=BD=D0=B5=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C?= =?UTF-8?q?=D0=B7=D1=83=D0=B5=D0=BC=D1=8B=D1=85=20=D0=BE=D0=B1=D1=80=D0=B0?= =?UTF-8?q?=D0=B7=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile_CD | 4 +++- Jenkinsfile_CI | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile_CD b/Jenkinsfile_CD index 1634fd5..7a2c03d 100644 --- a/Jenkinsfile_CD +++ b/Jenkinsfile_CD @@ -43,7 +43,9 @@ pipeline { } stage('Prune images') { steps { - sshpass -p ${SSH_PASS} ssh -o StrictHostKeyChecking=no ${SSH_USER}@${SSH_HOST} -p ${SSH_PORT} 'docker image prune -f' + sh """ + sshpass -p ${SSH_PASS} ssh -o StrictHostKeyChecking=no ${SSH_USER}@${SSH_HOST} -p ${SSH_PORT} 'docker image prune -f' + """ } } } diff --git a/Jenkinsfile_CI b/Jenkinsfile_CI index 29b9fcc..a216543 100644 --- a/Jenkinsfile_CI +++ b/Jenkinsfile_CI @@ -5,6 +5,12 @@ pipeline { args '-v /root/.m2:/root/.m2' } } + environment { + SSH_HOST = credentials('SSH_HOST') + SSH_PORT = credentials('SSH_PORT') + SSH_USER = credentials('SSH_USER') + SSH_PASS = credentials('SSH_PASS') + } stages { stage('Build') { steps { @@ -14,7 +20,9 @@ pipeline { } stage('Prune images') { steps { - sshpass -p ${SSH_PASS} ssh -o StrictHostKeyChecking=no ${SSH_USER}@${SSH_HOST} -p ${SSH_PORT} 'docker image prune -f' + sh """ + sshpass -p ${SSH_PASS} ssh -o StrictHostKeyChecking=no ${SSH_USER}@${SSH_HOST} -p ${SSH_PORT} 'docker image prune -f' + """ } } } \ No newline at end of file