From a722826a4a5ce9c9da905ec977a2b02292eadba6 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 7 Jun 2023 13:11:10 +0000 Subject: [PATCH 1/7] Bump version to 2.7.5 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index f5cff9d16e..e7ed66b4a7 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.7.4", + "version": "2.7.5", "npmClient": "yarn", "packages": [ "packages/backend-core", From f169e76fec63e605c37e7f2e3c3dab5d2290c0de Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 7 Jun 2023 13:30:02 +0000 Subject: [PATCH 2/7] Bump version to 2.7.6 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index e7ed66b4a7..891d732bf7 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.7.5", + "version": "2.7.6", "npmClient": "yarn", "packages": [ "packages/backend-core", From 70e4795349aca144ccb03724c8b8af766d8215e1 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 7 Jun 2023 16:35:36 +0100 Subject: [PATCH 3/7] Fix top level path within the single image to make sure it can find builder assets correctly. --- hosting/single/runner.sh | 1 + packages/server/src/api/controllers/static/index.ts | 2 +- packages/server/src/environment.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hosting/single/runner.sh b/hosting/single/runner.sh index 0bd377cd7f..d980202f88 100644 --- a/hosting/single/runner.sh +++ b/hosting/single/runner.sh @@ -17,6 +17,7 @@ declare -a DOCKER_VARS=("APP_PORT" "APPS_URL" "ARCHITECTURE" "BUDIBASE_ENVIRONME [[ -z "${WORKER_PORT}" ]] && export WORKER_PORT=4002 [[ -z "${WORKER_URL}" ]] && export WORKER_URL=http://localhost:4002 [[ -z "${APPS_URL}" ]] && export APPS_URL=http://localhost:4001 +[[ -z "${SERVER_TOP_LEVEL_PATH}" ]] && export SERVER_TOP_LEVEL_PATH=/app # export CUSTOM_DOMAIN=budi001.custom.com # Azure App Service customisations diff --git a/packages/server/src/api/controllers/static/index.ts b/packages/server/src/api/controllers/static/index.ts index bddde485ef..6879c09fda 100644 --- a/packages/server/src/api/controllers/static/index.ts +++ b/packages/server/src/api/controllers/static/index.ts @@ -67,7 +67,7 @@ export const toggleBetaUiFeature = async function (ctx: any) { } export const serveBuilder = async function (ctx: any) { - const builderPath = resolve(TOP_LEVEL_PATH, "builder") + const builderPath = join(TOP_LEVEL_PATH, "builder") await send(ctx, ctx.file, { root: builderPath }) } diff --git a/packages/server/src/environment.ts b/packages/server/src/environment.ts index 0ba708e7bb..ef55958ee0 100644 --- a/packages/server/src/environment.ts +++ b/packages/server/src/environment.ts @@ -98,7 +98,7 @@ const environment = { isInThread: () => { return process.env.FORKED_PROCESS }, - TOP_LEVEL_PATH: process.env.TOP_LEVEL_PATH, + TOP_LEVEL_PATH: process.env.TOP_LEVEL_PATH || process.env.SERVER_TOP_LEVEL_PATH, } // threading can cause memory issues with node-ts in development From 9ebd90a07d35d69b97d74635cb6f81aa059bb7f8 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 7 Jun 2023 16:36:43 +0100 Subject: [PATCH 4/7] Don't resolve anymore given we have an absolute top level path --- packages/server/src/api/controllers/static/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/api/controllers/static/index.ts b/packages/server/src/api/controllers/static/index.ts index 6879c09fda..49d2abfc79 100644 --- a/packages/server/src/api/controllers/static/index.ts +++ b/packages/server/src/api/controllers/static/index.ts @@ -1,6 +1,6 @@ require("svelte/register") -import { resolve, join } from "../../../utilities/centralPath" +import { join } from "../../../utilities/centralPath" const uuid = require("uuid") import { ObjectStoreBuckets } from "../../../constants" import { processString } from "@budibase/string-templates" @@ -49,7 +49,7 @@ export const toggleBetaUiFeature = async function (ctx: any) { return } - let builderPath = resolve(TOP_LEVEL_PATH, "new_design_ui") + let builderPath = join(TOP_LEVEL_PATH, "new_design_ui") // // download it from S3 if (!fs.existsSync(builderPath)) { From 8d7119a363c96671eff29ccc5726eb92b2918ef3 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 7 Jun 2023 16:37:42 +0100 Subject: [PATCH 5/7] Make sure top level path is resolved correctly. --- packages/server/src/environment.ts | 3 ++- packages/server/src/utilities/fileSystem/filesystem.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/server/src/environment.ts b/packages/server/src/environment.ts index ef55958ee0..64b342d577 100644 --- a/packages/server/src/environment.ts +++ b/packages/server/src/environment.ts @@ -98,7 +98,8 @@ const environment = { isInThread: () => { return process.env.FORKED_PROCESS }, - TOP_LEVEL_PATH: process.env.TOP_LEVEL_PATH || process.env.SERVER_TOP_LEVEL_PATH, + TOP_LEVEL_PATH: + process.env.TOP_LEVEL_PATH || process.env.SERVER_TOP_LEVEL_PATH, } // threading can cause memory issues with node-ts in development diff --git a/packages/server/src/utilities/fileSystem/filesystem.ts b/packages/server/src/utilities/fileSystem/filesystem.ts index 1c6971b1e8..9434f071d4 100644 --- a/packages/server/src/utilities/fileSystem/filesystem.ts +++ b/packages/server/src/utilities/fileSystem/filesystem.ts @@ -1,14 +1,14 @@ import { PathLike } from "fs" import fs from "fs" import { budibaseTempDir } from "../budibaseDir" -import { join } from "path" +import { resolve, join } from "path" import env from "../../environment" import tar from "tar" import environment from "../../environment" const uuid = require("uuid/v4") export const TOP_LEVEL_PATH = - environment.TOP_LEVEL_PATH || join(__dirname, "..", "..", "..") + environment.TOP_LEVEL_PATH || resolve(join(__dirname, "..", "..", "..")) /** * Upon first startup of instance there may not be everything we need in tmp directory, set it up. From 06a7a3184701e9724ecb5d85104926f525b04e0c Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 7 Jun 2023 16:39:33 +0100 Subject: [PATCH 6/7] Hardcoding the top level path for the app service as well. --- packages/server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/Dockerfile b/packages/server/Dockerfile index 78dcb38dcf..223b96a2ab 100644 --- a/packages/server/Dockerfile +++ b/packages/server/Dockerfile @@ -14,7 +14,7 @@ ENV SERVICE=app-service ENV POSTHOG_TOKEN=phc_bIjZL7oh2GEUd2vqvTBH8WvrX0fWTFQMs6H5KQxiUxU ENV TENANT_FEATURE_FLAGS=*:LICENSING,*:USER_GROUPS,*:ONBOARDING_TOUR ENV ACCOUNT_PORTAL_URL=https://account.budibase.app - +ENV TOP_LEVEL_PATH=/ # handle node-gyp RUN apt-get update \ From b2a21addc31fc87269bed8dbca1eec27b1ea1208 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 7 Jun 2023 17:18:59 +0100 Subject: [PATCH 7/7] Updating release workflows to use a script instead of repeating and adding scripts for updating and resetting dependencies if attempting to build packages locally. --- .github/workflows/release-develop.yml | 13 +----------- .github/workflows/release-master.yml | 13 +----------- .github/workflows/release-singleimage.yml | 26 ++--------------------- packages/worker/package.json | 2 +- scripts/resetVersions.sh | 7 ++++++ scripts/updateVersions.sh | 12 +++++++++++ 6 files changed, 24 insertions(+), 49 deletions(-) create mode 100755 scripts/resetVersions.sh create mode 100755 scripts/updateVersions.sh diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml index 9bb37d7356..a7bf041eb5 100644 --- a/.github/workflows/release-develop.yml +++ b/.github/workflows/release-develop.yml @@ -48,18 +48,7 @@ jobs: - run: yarn install --frozen-lockfile - name: Update versions - run: | - version=$(cat lerna.json \ - | grep version \ - | head -1 \ - | awk -F: '{gsub(/"/,"",$2);gsub(/[[:space:]]*/,"",$2); print $2}' \ - | sed 's/[",]//g') - echo "Setting version $version" - yarn lerna exec "yarn version --no-git-tag-version --new-version=$version" - echo "Updating dependencies" - node scripts/syncLocalDependencies.js $version - echo "Syncing yarn workspace" - yarn + run: ./scripts/updateVersions.sh - run: yarn build - run: yarn build:sdk diff --git a/.github/workflows/release-master.yml b/.github/workflows/release-master.yml index a105d8a712..68625ad7af 100644 --- a/.github/workflows/release-master.yml +++ b/.github/workflows/release-master.yml @@ -41,18 +41,7 @@ jobs: - run: yarn install --frozen-lockfile - name: Update versions - run: | - version=$(cat lerna.json \ - | grep version \ - | head -1 \ - | awk -F: '{gsub(/"/,"",$2);gsub(/[[:space:]]*/,"",$2); print $2}' \ - | sed 's/[",]//g') - echo "Setting version $version" - yarn lerna exec "yarn version --no-git-tag-version --new-version=$version" - echo "Updating dependencies" - node scripts/syncLocalDependencies.js $version - echo "Syncing yarn workspace" - yarn + run: ./scripts/updateVersions.sh - run: yarn lint - run: yarn build - run: yarn build:sdk diff --git a/.github/workflows/release-singleimage.yml b/.github/workflows/release-singleimage.yml index eadf40ca00..5408b48ef8 100644 --- a/.github/workflows/release-singleimage.yml +++ b/.github/workflows/release-singleimage.yml @@ -47,33 +47,11 @@ jobs: - name: Run Yarn run: yarn - name: Update versions - run: | - version=$(cat lerna.json \ - | grep version \ - | head -1 \ - | awk -F: '{gsub(/"/,"",$2);gsub(/[[:space:]]*/,"",$2); print $2}' \ - | sed 's/[",]//g') - echo "Setting version $version" - yarn lerna exec "yarn version --no-git-tag-version --new-version=$version" - echo "Updating dependencies" - node scripts/syncLocalDependencies.js $version - echo "Syncing yarn workspace" - yarn + run: ./scripts/updateVersions.sh - name: Runt Yarn Lint run: yarn lint - name: Update versions - run: | - version=$(cat lerna.json \ - | grep version \ - | head -1 \ - | awk -F: '{gsub(/"/,"",$2);gsub(/[[:space:]]*/,"",$2); print $2}' \ - | sed 's/[",]//g') - echo "Setting version $version" - yarn lerna exec "yarn version --no-git-tag-version --new-version=$version" - echo "Updating dependencies" - node scripts/syncLocalDependencies.js $version - echo "Syncing yarn workspace" - yarn + run: ./scripts/updateVersions.sh - name: Run Yarn Build run: yarn build:docker:pre - name: Login to Docker Hub diff --git a/packages/worker/package.json b/packages/worker/package.json index f07cb011a0..b11512f88f 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -104,4 +104,4 @@ "update-dotenv": "1.1.1" }, "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc" -} \ No newline at end of file +} diff --git a/scripts/resetVersions.sh b/scripts/resetVersions.sh new file mode 100755 index 0000000000..83411f5153 --- /dev/null +++ b/scripts/resetVersions.sh @@ -0,0 +1,7 @@ +#!/bin/bash +echo "Resetting package versions" +yarn lerna exec "yarn version --no-git-tag-version --new-version=0.0.0" +echo "Updating dependencies" +node scripts/syncLocalDependencies.js "0.0.0" +git checkout package.json +echo "Package versions reset!" diff --git a/scripts/updateVersions.sh b/scripts/updateVersions.sh new file mode 100755 index 0000000000..51ad70366c --- /dev/null +++ b/scripts/updateVersions.sh @@ -0,0 +1,12 @@ +#!/bin/bash +version=$(cat lerna.json \ + | grep version \ + | head -1 \ + | awk -F: '{gsub(/"/,"",$2);gsub(/[[:space:]]*/,"",$2); print $2}' \ + | sed 's/[",]//g') +echo "Setting version $version" +yarn lerna exec "yarn version --no-git-tag-version --new-version=$version" +echo "Updating dependencies" +node scripts/syncLocalDependencies.js $version +echo "Syncing yarn workspace" +yarn