From 129d36ccfe0ce020e04c6316250d18facb543db5 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 10 Nov 2020 17:08:02 +0000 Subject: [PATCH 1/2] remove cf invalidation, adding validation around successful deploys only --- .../deploy/DeploymentHistory.svelte | 11 +++-- .../pages/[application]/deploy/index.svelte | 14 +----- .../server/src/api/controllers/deploy/aws.js | 45 +------------------ .../src/api/controllers/deploy/index.js | 43 ++---------------- packages/server/src/api/index.js | 2 + 5 files changed, 17 insertions(+), 98 deletions(-) diff --git a/packages/builder/src/components/deploy/DeploymentHistory.svelte b/packages/builder/src/components/deploy/DeploymentHistory.svelte index 417423a985..05a2e40fa6 100644 --- a/packages/builder/src/components/deploy/DeploymentHistory.svelte +++ b/packages/builder/src/components/deploy/DeploymentHistory.svelte @@ -44,6 +44,7 @@ } onMount(() => { + fetchDeployments() poll = setInterval(fetchDeployments, POLL_INTERVAL) }) @@ -55,10 +56,12 @@

Deployment History

- - View Your Deployed App → - - + {#if deployments.some(deployment => deployment.status === 'SUCCESS')} + + View Your Deployed App → + + + {/if}
diff --git a/packages/builder/src/pages/[application]/deploy/index.svelte b/packages/builder/src/pages/[application]/deploy/index.svelte index 0563c4e2cc..462601ff48 100644 --- a/packages/builder/src/pages/[application]/deploy/index.svelte +++ b/packages/builder/src/pages/[application]/deploy/index.svelte @@ -17,19 +17,16 @@ $: appId = $store.appId async function deployApp() { - loading = true const DEPLOY_URL = `/api/deploy` try { - notifier.info("Starting Deployment..") + notifier.info(`Deployment started. Please wait.`) const response = await api.post(DEPLOY_URL) const json = await response.json() if (response.status !== 200) { throw new Error() } - notifier.info(`Deployment started. Please wait.`) - loading = false analytics.captureEvent("Deployed App", { appId, }) @@ -43,7 +40,6 @@ }) analytics.captureException(err) notifier.danger("Deployment unsuccessful. Please try again later.") - loading = false } } @@ -51,13 +47,7 @@

It's time to shine!

- +
{ } }) +router.get("/health", ctx => (ctx.status = 200)) + router.use(authRoutes.routes()) router.use(authRoutes.allowedMethods()) From faf9fd475442276913b18bd8b116d69e0fd6b1a7 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 10 Nov 2020 17:16:40 +0000 Subject: [PATCH 2/2] increasing log level in production --- packages/server/.env.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/.env.template b/packages/server/.env.template index 4895d0309c..1b1ff2e854 100644 --- a/packages/server/.env.template +++ b/packages/server/.env.template @@ -12,7 +12,7 @@ JWT_SECRET={{cookieKey1}} PORT=4001 # error level for koa-pino -LOG_LEVEL=error +LOG_LEVEL=info DEPLOYMENT_CREDENTIALS_URL="https://dt4mpwwap8.execute-api.eu-west-1.amazonaws.com/prod/" DEPLOYMENT_DB_URL="https://couchdb.budi.live:5984"