[api] Jenkinsfile.pjt

- 도커 pull까지 완성
This commit is contained in:
2026-02-03 16:56:46 +09:00
parent 1113355c74
commit a5ec049040
+46
View File
@@ -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
'
'''
}
}
}
} }
} }