fix(deploy): reliably transfer exact build image and simplify production deploy scripts

This commit is contained in:
2026-03-07 08:14:10 +00:00
parent ea57734fa8
commit 23ad8af20e
3 changed files with 33 additions and 5 deletions

17
Jenkinsfile vendored
View File

@@ -105,8 +105,21 @@ rsync -az \
scripts/ \
"$APP_USER@$APP_HOST:$DEPLOY_PATH/scripts/"
docker save ${IMAGE_LATEST} ${IMAGE_BUILD} \
| ssh -i "$SSH_KEY" "$APP_USER@$APP_HOST" 'docker load'
echo "Deploying image tag: ${IMAGE_BUILD}"
IMAGE_TAR="plesk-agency-portal-build-${BUILD_NUMBER}.tar"
echo "Creating image archive: ${IMAGE_TAR}"
docker save -o "${IMAGE_TAR}" "${IMAGE_BUILD}"
ls -lh "${IMAGE_TAR}"
echo "Copying image archive to remote host"
rsync -az \
-e "ssh -i $SSH_KEY" \
"${IMAGE_TAR}" \
"$APP_USER@$APP_HOST:$DEPLOY_PATH/"
echo "Loading image archive on remote host"
ssh -i "$SSH_KEY" "$APP_USER@$APP_HOST" "docker load -i $DEPLOY_PATH/${IMAGE_TAR}"
ssh -i "$SSH_KEY" "$APP_USER@$APP_HOST" "docker images | grep plesk-agency-portal || true"