From f63466f1d167d9c05c7174904718c790e08ef489 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 15 Dec 2020 17:27:45 +0000 Subject: [PATCH] Updating deployment service, checking in builder the builder settings info stored in DB before deploying. --- .../src/builderStore/store/frontend.js | 2 ++ .../builder/src/builderStore/store/hosting.js | 6 ++-- .../automation/Shared/WebhookDisplay.svelte | 5 +-- .../deploy/DeploymentHistory.svelte | 5 +-- .../src/api/controllers/deploy/index.js | 31 ++++++++++++------- .../server/src/api/controllers/hosting.js | 12 +++---- packages/server/src/api/routes/hosting.js | 1 + 7 files changed, 35 insertions(+), 27 deletions(-) diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index 3b02edcfdb..dc168ac97c 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -8,6 +8,7 @@ import { import { allScreens, backendUiStore, + hostingStore, currentAsset, mainLayout, selectedComponent, @@ -69,6 +70,7 @@ export const getFrontendStore = () => { appInstance: pkg.application.instance, })) + await hostingStore.actions.fetch() await backendUiStore.actions.database.select(pkg.application.instance) }, routing: { diff --git a/packages/builder/src/builderStore/store/hosting.js b/packages/builder/src/builderStore/store/hosting.js index 3e452920d2..722efb6dbd 100644 --- a/packages/builder/src/builderStore/store/hosting.js +++ b/packages/builder/src/builderStore/store/hosting.js @@ -10,10 +10,11 @@ export const getHostingStore = () => { const store = writable({ ...INITIAL_BACKEND_UI_STATE }) store.actions = { fetch: async () => { - const response = await api.get("/api/hosting/") - const info = await response.json() + const responses = await Promise.all([api.get("/api/hosting/"), api.get("/api/hosting/urls")]) + const [info, urls] = await Promise.all(responses.map(resp => resp.json())) store.update(state => { state.hostingInfo = info + state.appUrl = urls.appServer return state }) return info @@ -30,6 +31,5 @@ export const getHostingStore = () => { }) }, } - return store } diff --git a/packages/builder/src/components/automation/Shared/WebhookDisplay.svelte b/packages/builder/src/components/automation/Shared/WebhookDisplay.svelte index 3299206e78..2edcbec3f1 100644 --- a/packages/builder/src/components/automation/Shared/WebhookDisplay.svelte +++ b/packages/builder/src/components/automation/Shared/WebhookDisplay.svelte @@ -1,16 +1,17 @@