[api] Jenkinsfile.pjt

- 도커 pull까지 완성
This commit is contained in:
2026-02-03 17:00:54 +09:00
parent a5ec049040
commit cbf40f3099
+14 -11
View File
@@ -100,20 +100,22 @@ pipeline {
steps {
sshagent(['ssh-pjt']) {
withCredentials([usernamePassword(
credentialsId: "${DOCKER_CRED}",
usernameVariable: 'REG_USER',
passwordVariable: 'REG_PASS'
credentialsId: DOCKER_CRED,
usernameVariable: 'DOCKER_USER',
passwordVariable: 'DOCKER_PASS'
)]) {
sh '''
set -e
ssh -p ${SSH_PORT} -o StrictHostKeyChecking=no \
ssh -p ${SSH_PORT} \
-o StrictHostKeyChecking=no \
-o UserKnownHostsFile=/dev/null \
${SSH_USER}@${SSH_HOST} \
REGISTRY_HOST="${REGISTRY_HOST}" \
REG_USER="${REG_USER}" \
REG_PASS="${REG_PASS}" \
DOCKER_USER="${DOCKER_USER}" \
DOCKER_PASS="${DOCKER_PASS}" \
'set -e
echo "$REG_PASS" | docker login "$REGISTRY_HOST" -u "$REG_USER" --password-stdin
echo "$DOCKER_PASS" | docker login "$REGISTRY_HOST" -u "$DOCKER_USER" --password-stdin
'
'''
}
@@ -127,19 +129,20 @@ pipeline {
sh '''
set -e
ssh -p ${SSH_PORT} -o StrictHostKeyChecking=no \
ssh -p ${SSH_PORT} \
-o StrictHostKeyChecking=no \
-o UserKnownHostsFile=/dev/null \
${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
cd '"${SSH_COMPOSE_DIR}"'
docker compose -f '"${SSH_COMPOSE_FILE}"' pull
'
'''
}
}
}
}
}