fix(deploy): reliably transfer exact build image and simplify production deploy scripts
This commit is contained in:
17
Jenkinsfile
vendored
17
Jenkinsfile
vendored
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user