-
-
Notifications
You must be signed in to change notification settings - Fork 65
Add service update paused case for swarm deployment log parsing
#456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,14 +127,14 @@ ifeq ($(PRIMARY_GOAL),prod-deploy) | |
| prod-deploy: ## Deploy to production. | ||
| set -euo pipefail \ | ||
| docker -H ${PROD_SSH} stack deploy --prune --detach=false --with-registry-auth -c docker/compose.yml -c docker/prod/compose.yml ${STACK_NAME} 2>&1 | tee deploy.log \ | ||
| if grep -qiE 'rollback:|update rolled back' deploy.log then \ | ||
| if grep -qiE 'rollback:|update rolled back|service update paused' deploy.log then \ | ||
|
Comment on lines
128
to
+130
|
||
| FAILED_TASK_ID="$(grep -oiE 'task[[:space:]]+[a-z0-9]+' deploy.log | head -n 1 | awk '{print $2}')" \ | ||
| if [ -n "${FAILED_TASK_ID}" ]; then \ | ||
| echo "Docker Swarm update rolled back; failing job. Failed task ID: ${FAILED_TASK_ID}" \ | ||
| echo "Docker Swarm update failed. Failed task ID: ${FAILED_TASK_ID}" \ | ||
| echo "--- docker service logs (${FAILED_TASK_ID}) ---" \ | ||
| docker -H ${PROD_SSH} service logs --timestamps --tail 500 "${FAILED_TASK_ID}" || true \ | ||
| else \ | ||
| echo 'Docker Swarm update rolled back; failing job. Failed task ID: not found in deploy output.' \ | ||
| echo 'Docker Swarm update failed. Failed task ID: not found in deploy output.' \ | ||
| fi \ | ||
| exit 1 \ | ||
| fi | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CHANGELOG entry references
#456, but the linked issue/intent in the PR description isyiisoft/app#455. Please update the issue/PR number in the changelog line to match the correct tracker reference.