From af6b7baa6cd38a383b80f6b8f3e09da1e2805941 Mon Sep 17 00:00:00 2001 From: Sergei Antipov Date: Thu, 16 May 2019 12:42:05 -0400 Subject: [PATCH] Use postUpdate hook to check gravity site status after upgrade --- assets/site-app/images/hook/entrypoint.sh | 2 +- assets/site-app/resources/app.yaml | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/assets/site-app/images/hook/entrypoint.sh b/assets/site-app/images/hook/entrypoint.sh index 88187e4f44..f70cdacacf 100755 --- a/assets/site-app/images/hook/entrypoint.sh +++ b/assets/site-app/images/hook/entrypoint.sh @@ -1,5 +1,5 @@ #!/bin/sh -set -e +set -ex echo "Assuming changeset from the environment: $RIG_CHANGESET" # note that rig does not take explicit changeset ID diff --git a/assets/site-app/resources/app.yaml b/assets/site-app/resources/app.yaml index 91265b1a9a..08abd520b4 100644 --- a/assets/site-app/resources/app.yaml +++ b/assets/site-app/resources/app.yaml @@ -25,6 +25,22 @@ hooks: - name: hook image: site-app-hook:0.0.1 args: ["update"] + postUpdate: + job: | + apiVersion: batch/v1 + kind: Job + metadata: + name: site-app-post-update + spec: + template: + metadata: + name: site-app-post-update + spec: + restartPolicy: OnFailure + containers: + - name: post-update-hook + image: quay.io/gravitational/debian-tall:stretch + command: ["/opt/bin/gravity", "site", "status"] rollback: job: | apiVersion: batch/v1