diff --git a/Jenkinsfile.pjt b/Jenkinsfile.pjt index 36a6052..c1d786d 100644 --- a/Jenkinsfile.pjt +++ b/Jenkinsfile.pjt @@ -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 ' ''' } } - } } }