From bec7d86739741c20634d0446399f3b64b159c57e Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 28 Jun 2022 13:14:49 +0100 Subject: [PATCH] cherry pick new ui from develop --- .github/workflows/budibase_ci.yml | 17 ++++++++ .../backend-core/src/objectStore/index.ts | 10 +++++ .../builder/app/[application]/_layout.svelte | 27 +++++++++++- packages/builder/src/stores/backend/flags.js | 3 ++ packages/builder/vite.config.js | 3 ++ packages/frontend-core/src/api/flags.js | 9 ++++ packages/frontend-core/src/api/other.js | 9 ++++ packages/server/.gitignore | 1 + .../server/src/api/controllers/application.ts | 6 ++- packages/server/src/api/controllers/dev.js | 37 +++++++++++++++- .../src/api/controllers/static/index.js | 43 ++++++++++++++++++- packages/server/src/api/routes/dev.js | 1 + packages/server/src/api/routes/static.ts | 1 + .../src/utilities/fileSystem/utilities.js | 2 + packages/server/src/utilities/index.js | 8 +++- packages/server/yarn.lock | 18 ++++---- packages/worker/.dockerignore | 7 +++ packages/worker/yarn.lock | 18 ++++---- 18 files changed, 195 insertions(+), 25 deletions(-) create mode 100644 packages/worker/.dockerignore diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index e940e6fa10..1303d5921a 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -7,6 +7,7 @@ on: branches: - master - develop + - new-design-ui pull_request: branches: - master @@ -59,3 +60,19 @@ jobs: with: install: false command: yarn test:e2e:ci + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: eu-west-1 + + - name: Upload to S3 + if: github.ref == 'refs/heads/new-design-ui' + run: | + tar -czvf new_ui.tar.gz packages/server/assets packages/server/index.html + aws s3 cp new_ui.tar.gz s3://prod-budi-app-assets/beta:design_ui/ + aws s3 cp packages/client/dist/budibase-client.js s3://prod-budi-app-assets/beta:design_ui/budibase-client.js + aws cloudfront create-invalidation --distribution-id E3ELKP4RCEHVLW --paths "/beta:design_ui/*" + diff --git a/packages/backend-core/src/objectStore/index.ts b/packages/backend-core/src/objectStore/index.ts index 9bb0760f5b..a7e0b0c134 100644 --- a/packages/backend-core/src/objectStore/index.ts +++ b/packages/backend-core/src/objectStore/index.ts @@ -294,6 +294,16 @@ export const uploadDirectory = async ( await Promise.all(uploads) } +exports.downloadTarballDirect = async (url: string, path: string) => { + path = sanitizeKey(path) + const response = await fetch(url) + if (!response.ok) { + throw new Error(`unexpected response ${response.statusText}`) + } + + await streamPipeline(response.body, zlib.Unzip(), tar.extract(path)) +} + export const downloadTarball = async (url: any, bucketName: any, path: any) => { bucketName = sanitizeBucket(bucketName) path = sanitizeKey(path) diff --git a/packages/builder/src/pages/builder/app/[application]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/_layout.svelte index ebe5e32653..8c3de02202 100644 --- a/packages/builder/src/pages/builder/app/[application]/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_layout.svelte @@ -1,7 +1,14 @@