[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 { steps {
sshagent(['ssh-pjt']) { sshagent(['ssh-pjt']) {
withCredentials([usernamePassword( withCredentials([usernamePassword(
credentialsId: "${DOCKER_CRED}", credentialsId: DOCKER_CRED,
usernameVariable: 'REG_USER', usernameVariable: 'DOCKER_USER',
passwordVariable: 'REG_PASS' passwordVariable: 'DOCKER_PASS'
)]) { )]) {
sh ''' sh '''
set -e set -e
ssh -p ${SSH_PORT} -o StrictHostKeyChecking=no \ ssh -p ${SSH_PORT} \
-o StrictHostKeyChecking=no \
-o UserKnownHostsFile=/dev/null \
${SSH_USER}@${SSH_HOST} \ ${SSH_USER}@${SSH_HOST} \
REGISTRY_HOST="${REGISTRY_HOST}" \ REGISTRY_HOST="${REGISTRY_HOST}" \
REG_USER="${REG_USER}" \ DOCKER_USER="${DOCKER_USER}" \
REG_PASS="${REG_PASS}" \ DOCKER_PASS="${DOCKER_PASS}" \
'set -e '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 ''' sh '''
set -e set -e
ssh -p ${SSH_PORT} -o StrictHostKeyChecking=no \ ssh -p ${SSH_PORT} \
-o StrictHostKeyChecking=no \
-o UserKnownHostsFile=/dev/null \
${SSH_USER}@${SSH_HOST} \ ${SSH_USER}@${SSH_HOST} \
REGISTRY_HOST="${REGISTRY_HOST}" \ REGISTRY_HOST="${REGISTRY_HOST}" \
IMAGE_REPO="${IMAGE_REPO}" \ IMAGE_REPO="${IMAGE_REPO}" \
IMAGE_TAG="${IMAGE_TAG}" \ IMAGE_TAG="${IMAGE_TAG}" \
'set -e 'set -e
cd ${SSH_COMPOSE_DIR} cd '"${SSH_COMPOSE_DIR}"'
docker compose -f ${SSH_COMPOSE_FILE} pull docker compose -f '"${SSH_COMPOSE_FILE}"' pull
' '
''' '''
} }
} }
}
} }
} }