From a5ec049040d337c6a12cc6a43aa04ae5e8afe066 Mon Sep 17 00:00:00 2001 From: shindw Date: Tue, 3 Feb 2026 16:56:46 +0900 Subject: [PATCH] =?UTF-8?q?[api]=20Jenkinsfile.pjt=20-=20=EB=8F=84?= =?UTF-8?q?=EC=BB=A4=20pull=EA=B9=8C=EC=A7=80=20=EC=99=84=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile.pjt | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/Jenkinsfile.pjt b/Jenkinsfile.pjt index 1dee48c..36a6052 100644 --- a/Jenkinsfile.pjt +++ b/Jenkinsfile.pjt @@ -95,5 +95,51 @@ pipeline { } } } + + stage('7) Remote docker login') { + steps { + sshagent(['ssh-pjt']) { + withCredentials([usernamePassword( + credentialsId: "${DOCKER_CRED}", + usernameVariable: 'REG_USER', + passwordVariable: 'REG_PASS' + )]) { + sh ''' + set -e + + ssh -p ${SSH_PORT} -o StrictHostKeyChecking=no \ + ${SSH_USER}@${SSH_HOST} \ + REGISTRY_HOST="${REGISTRY_HOST}" \ + REG_USER="${REG_USER}" \ + REG_PASS="${REG_PASS}" \ + 'set -e + echo "$REG_PASS" | docker login "$REGISTRY_HOST" -u "$REG_USER" --password-stdin + ' + ''' + } + } + } + } + + stage('8) Remote docker pull') { + steps { + sshagent(['ssh-pjt']) { + sh ''' + set -e + + ssh -p ${SSH_PORT} -o StrictHostKeyChecking=no \ + ${SSH_USER}@${SSH_HOST} \ + REGISTRY_HOST="${REGISTRY_HOST}" \ + IMAGE_REPO="${IMAGE_REPO}" \ + IMAGE_TAG="${IMAGE_TAG}" \ + 'set -e + cd ${SSH_COMPOSE_DIR} + docker compose -f ${SSH_COMPOSE_FILE} pull + ' + ''' + } + } + } + } }