From 961913b88a3208924eba14a9602b853d9e6de8ce Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 20 Oct 2023 16:21:35 +0200 Subject: [PATCH 01/17] Use version from environment --- packages/backend-core/src/environment.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/backend-core/src/environment.ts b/packages/backend-core/src/environment.ts index 3894bdd0f7..4fb8b5fdca 100644 --- a/packages/backend-core/src/environment.ts +++ b/packages/backend-core/src/environment.ts @@ -49,7 +49,6 @@ function httpLogging() { } function getPackageJsonFields(): { - VERSION: string SERVICE_NAME: string } { function findFileInAncestors( @@ -75,12 +74,11 @@ function getPackageJsonFields(): { const content = readFileSync(packageJsonFile!, "utf-8") const parsedContent = JSON.parse(content) return { - VERSION: parsedContent.version, SERVICE_NAME: parsedContent.name, } } catch { // throwing an error here is confusing/causes backend-core to be hard to import - return { VERSION: "", SERVICE_NAME: "" } + return { SERVICE_NAME: "" } } } @@ -173,6 +171,7 @@ const environment = { ENABLE_SSO_MAINTENANCE_MODE: selfHosted ? process.env.ENABLE_SSO_MAINTENANCE_MODE : false, + VERSION: process.env.VERSION!, ...getPackageJsonFields(), DISABLE_PINO_LOGGER: process.env.DISABLE_PINO_LOGGER, OFFLINE_MODE: process.env.OFFLINE_MODE, From 56ae857d498908c95c2c8e8146455ca170eaf8b0 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 20 Oct 2023 16:21:48 +0200 Subject: [PATCH 02/17] Add version to dev .env --- packages/server/scripts/dev/manage.js | 1 + packages/worker/scripts/dev/manage.js | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/server/scripts/dev/manage.js b/packages/server/scripts/dev/manage.js index 5db45040bf..13639b6bfd 100644 --- a/packages/server/scripts/dev/manage.js +++ b/packages/server/scripts/dev/manage.js @@ -47,6 +47,7 @@ async function init() { TENANT_FEATURE_FLAGS: "*:LICENSING,*:USER_GROUPS,*:ONBOARDING_TOUR", HTTP_MIGRATIONS: "0", HTTP_LOGGING: "0", + VERSION: "0.0.0+local", } let envFile = "" Object.keys(envFileJson).forEach(key => { diff --git a/packages/worker/scripts/dev/manage.js b/packages/worker/scripts/dev/manage.js index ecf5defd47..9e6a57d4bf 100644 --- a/packages/worker/scripts/dev/manage.js +++ b/packages/worker/scripts/dev/manage.js @@ -31,6 +31,7 @@ async function init() { TENANT_FEATURE_FLAGS: "*:LICENSING,*:USER_GROUPS,*:ONBOARDING_TOUR", ENABLE_EMAIL_TEST_MODE: 1, HTTP_LOGGING: 0, + VERSION: "0.0.0+local", } let envFile = "" Object.keys(envFileJson).forEach(key => { From 4c19ad1ca7f27c9713b9551bd4711aee6b081685 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 20 Oct 2023 17:19:35 +0200 Subject: [PATCH 03/17] Add versions to server/worker docker v2 --- hosting/docker-compose.build.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hosting/docker-compose.build.yaml b/hosting/docker-compose.build.yaml index e192620b59..19ce9b5473 100644 --- a/hosting/docker-compose.build.yaml +++ b/hosting/docker-compose.build.yaml @@ -7,6 +7,8 @@ services: build: context: .. dockerfile: packages/server/Dockerfile.v2 + args: + - VERSION=0.0.0+dev-docker container_name: build-bbapps environment: SELF_HOSTED: 1 @@ -30,13 +32,13 @@ services: depends_on: - worker-service - redis-service - # volumes: - # - /some/path/to/plugins:/plugins worker-service: build: context: .. dockerfile: packages/worker/Dockerfile.v2 + args: + - VERSION=0.0.0+dev-docker container_name: build-bbworker environment: SELF_HOSTED: 1 From 9dacb5849b126b69ae5006a39205719dd6e79a35 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 20 Oct 2023 17:19:44 +0200 Subject: [PATCH 04/17] Add versions to server/worker docker v2 --- packages/server/Dockerfile.v2 | 4 ++++ packages/worker/Dockerfile.v2 | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/packages/server/Dockerfile.v2 b/packages/server/Dockerfile.v2 index d5a86b037d..339cefcc45 100644 --- a/packages/server/Dockerfile.v2 +++ b/packages/server/Dockerfile.v2 @@ -67,6 +67,10 @@ COPY packages/server/docker_run.sh . COPY packages/server/builder/ builder/ COPY packages/server/client/ client/ +ARG VERSION +RUN test -n "$VERSION" +ENV VERSION=$VERSION + EXPOSE 4001 # have to add node environment production after install diff --git a/packages/worker/Dockerfile.v2 b/packages/worker/Dockerfile.v2 index 0d60db6fc5..20fcd4a69b 100644 --- a/packages/worker/Dockerfile.v2 +++ b/packages/worker/Dockerfile.v2 @@ -50,4 +50,8 @@ ENV POSTHOG_TOKEN=phc_bIjZL7oh2GEUd2vqvTBH8WvrX0fWTFQMs6H5KQxiUxU ENV TENANT_FEATURE_FLAGS=*:LICENSING,*:USER_GROUPS,*:ONBOARDING_TOUR ENV ACCOUNT_PORTAL_URL=https://account.budibase.app +ARG VERSION +RUN test -n "$VERSION" +ENV VERSION=$VERSION + CMD ["./docker_run.sh"] From 133e4752576c27bd2f41f68578236aa31b7a48e4 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 20 Oct 2023 17:20:14 +0200 Subject: [PATCH 05/17] Add version to single image --- hosting/single/Dockerfile.v2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hosting/single/Dockerfile.v2 b/hosting/single/Dockerfile.v2 index a983f10044..ecc223be15 100644 --- a/hosting/single/Dockerfile.v2 +++ b/hosting/single/Dockerfile.v2 @@ -118,6 +118,9 @@ EXPOSE 443 EXPOSE 2222 VOLUME /data +ARG VERSION +RUN test -n "$VERSION" +ENV VERSION=$VERSION HEALTHCHECK --interval=15s --timeout=15s --start-period=45s CMD "/healthcheck.sh" From 6ff11a82994719c556c3e68d46a5c5d35a5a57bf Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 20 Oct 2023 17:23:16 +0200 Subject: [PATCH 06/17] Fix local docker singleimage build --- scripts/build-single-image.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/build-single-image.sh b/scripts/build-single-image.sh index cb2c29deac..216d758fae 100755 --- a/scripts/build-single-image.sh +++ b/scripts/build-single-image.sh @@ -1,3 +1,4 @@ #!/bin/bash yarn build --scope @budibase/server --scope @budibase/worker -docker build -f hosting/single/Dockerfile.v2 -t budibase:latest . +version=$(./scripts/getCurrentVersion.sh) +docker build -f hosting/single/Dockerfile.v2 -t budibase:latest --build-arg VERSION=$version . From 5ee1d73e8160d13862a1dd8f6883d2073380745e Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 20 Oct 2023 17:25:30 +0200 Subject: [PATCH 07/17] Add args to build --- packages/server/package.json | 2 +- packages/worker/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 0bc3618a08..0636eebe77 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -18,7 +18,7 @@ "test": "bash scripts/test.sh", "test:memory": "jest --maxWorkers=2 --logHeapUsage --forceExit", "test:watch": "jest --watch", - "build:docker": "yarn build && docker build . -t app-service --label version=$BUDIBASE_RELEASE_VERSION", + "build:docker": "yarn build && docker build . -t app-service --label version=$BUDIBASE_RELEASE_VERSION --build-arg VERSION=$BUDIBASE_RELEASE_VERSION", "run:docker": "node dist/index.js", "run:docker:cluster": "pm2-runtime start pm2.config.js", "dev:stack:up": "node scripts/dev/manage.js up", diff --git a/packages/worker/package.json b/packages/worker/package.json index 1eee3f020f..0a75eac522 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -20,7 +20,7 @@ "run:docker": "node dist/index.js", "debug": "yarn build && node --expose-gc --inspect=9223 dist/index.js", "run:docker:cluster": "pm2-runtime start pm2.config.js", - "build:docker": "yarn build && docker build . -t worker-service --label version=$BUDIBASE_RELEASE_VERSION", + "build:docker": "yarn build && docker build . -t worker-service --label version=$BUDIBASE_RELEASE_VERSION --build-arg VERSION=$BUDIBASE_RELEASE_VERSION", "dev:stack:init": "node ./scripts/dev/manage.js init", "dev:builder": "npm run dev:stack:init && nodemon", "dev:built": "yarn run dev:stack:init && yarn run run:docker", From 8db11ac174805355c1961defd7588629811de63f Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 20 Oct 2023 17:27:42 +0200 Subject: [PATCH 08/17] Add version to test image pipeline --- .github/workflows/release-singleimage-test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-singleimage-test.yml b/.github/workflows/release-singleimage-test.yml index 79b9afdd44..3d6c0d2b3c 100644 --- a/.github/workflows/release-singleimage-test.yml +++ b/.github/workflows/release-singleimage-test.yml @@ -54,6 +54,7 @@ jobs: push: true pull: true platforms: linux/amd64,linux/arm64 + build-args: VERSION=0.0.0+test tags: budibase/budibase-test:test file: ./hosting/single/Dockerfile.v2 cache-from: type=registry,ref=budibase/budibase-test:test @@ -64,6 +65,8 @@ jobs: context: . push: true platforms: linux/amd64 - build-args: TARGETBUILD=aas + build-args: | + TARGETBUILD=aas + VERSION=0.0.0+test tags: budibase/budibase-test:aas file: ./hosting/single/Dockerfile.v2 From d1f0e8fca0b4577e8ec0defa39f269727e793d77 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 20 Oct 2023 17:53:23 +0200 Subject: [PATCH 09/17] Fix tests --- packages/server/src/tests/jestEnv.ts | 1 + packages/worker/src/tests/jestEnv.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/server/src/tests/jestEnv.ts b/packages/server/src/tests/jestEnv.ts index 34c51009aa..c1f32eeec9 100644 --- a/packages/server/src/tests/jestEnv.ts +++ b/packages/server/src/tests/jestEnv.ts @@ -9,3 +9,4 @@ process.env.LOG_LEVEL = process.env.LOG_LEVEL || "error" process.env.MOCK_REDIS = "1" process.env.PLATFORM_URL = "http://localhost:10000" process.env.REDIS_PASSWORD = "budibase" +process.env.VERSION = "0.0.0+jest" diff --git a/packages/worker/src/tests/jestEnv.ts b/packages/worker/src/tests/jestEnv.ts index 9153676b8e..f6de4e0fd2 100644 --- a/packages/worker/src/tests/jestEnv.ts +++ b/packages/worker/src/tests/jestEnv.ts @@ -10,3 +10,4 @@ process.env.PLATFORM_URL = "http://localhost:10000" process.env.INTERNAL_API_KEY = "tet" process.env.DISABLE_ACCOUNT_PORTAL = "0" process.env.MOCK_REDIS = "1" +process.env.VERSION = "0.0.0+jest" From 71869badfa26e57035582bca3f3d670a9fc7a8c0 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 20 Oct 2023 19:19:35 +0200 Subject: [PATCH 10/17] Fix tests --- packages/server/src/api/routes/tests/debug.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/api/routes/tests/debug.spec.ts b/packages/server/src/api/routes/tests/debug.spec.ts index 23ee43fc73..26e98d93f9 100644 --- a/packages/server/src/api/routes/tests/debug.spec.ts +++ b/packages/server/src/api/routes/tests/debug.spec.ts @@ -41,7 +41,7 @@ describe("/component", () => { .expect("Content-Type", /json/) .expect(200) expect(res.body).toEqual({ - budibaseVersion: "0.0.0", + budibaseVersion: "0.0.0+jest", cpuArch: "arm64", cpuCores: 1, cpuInfo: "test", From e7459bb5e704685338032509334933f9fd80dede Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 20 Oct 2023 20:42:58 +0200 Subject: [PATCH 11/17] Fix test --- packages/server/src/api/routes/tests/dev.spec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/server/src/api/routes/tests/dev.spec.js b/packages/server/src/api/routes/tests/dev.spec.js index 111f3dbd5b..af1dc82a9d 100644 --- a/packages/server/src/api/routes/tests/dev.spec.js +++ b/packages/server/src/api/routes/tests/dev.spec.js @@ -1,6 +1,6 @@ const setup = require("./utilities") const { events } = require("@budibase/backend-core") -const version = require("../../../../package.json").version + describe("/dev", () => { let request = setup.getRequest() @@ -32,9 +32,9 @@ describe("/dev", () => { .expect("Content-Type", /json/) .expect(200) - expect(res.body.version).toBe(version) + expect(res.body.version).toBe('0.0.0+jest') expect(events.installation.versionChecked).toBeCalledTimes(1) - expect(events.installation.versionChecked).toBeCalledWith(version) + expect(events.installation.versionChecked).toBeCalledWith('0.0.0+jest') }) }) }) \ No newline at end of file From 4ee1fd0f7ad53a5ed6c08d202826a2b227adf4c1 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 23 Oct 2023 12:23:44 +0200 Subject: [PATCH 12/17] Default to package.json --- packages/backend-core/src/environment.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/backend-core/src/environment.ts b/packages/backend-core/src/environment.ts index 4fb8b5fdca..a0905fb0f5 100644 --- a/packages/backend-core/src/environment.ts +++ b/packages/backend-core/src/environment.ts @@ -49,6 +49,7 @@ function httpLogging() { } function getPackageJsonFields(): { + VERSION: string SERVICE_NAME: string } { function findFileInAncestors( @@ -74,11 +75,12 @@ function getPackageJsonFields(): { const content = readFileSync(packageJsonFile!, "utf-8") const parsedContent = JSON.parse(content) return { + VERSION: process.env.VERSION || parsedContent.version, SERVICE_NAME: parsedContent.name, } } catch { // throwing an error here is confusing/causes backend-core to be hard to import - return { SERVICE_NAME: "" } + return { VERSION: process.env.VERSION || "", SERVICE_NAME: "" } } } @@ -171,7 +173,6 @@ const environment = { ENABLE_SSO_MAINTENANCE_MODE: selfHosted ? process.env.ENABLE_SSO_MAINTENANCE_MODE : false, - VERSION: process.env.VERSION!, ...getPackageJsonFields(), DISABLE_PINO_LOGGER: process.env.DISABLE_PINO_LOGGER, OFFLINE_MODE: process.env.OFFLINE_MODE, From 0cc7cc67a388db38fbb03bbcf2adb1ce3ed3b364 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 23 Oct 2023 13:53:18 +0200 Subject: [PATCH 13/17] Renames --- .github/workflows/release-singleimage-test.yml | 4 ++-- hosting/docker-compose.build.yaml | 4 ++-- hosting/single/Dockerfile.v2 | 6 +++--- packages/server/Dockerfile.v2 | 6 +++--- packages/server/package.json | 2 +- packages/worker/Dockerfile.v2 | 6 +++--- packages/worker/package.json | 2 +- scripts/build-single-image.sh | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release-singleimage-test.yml b/.github/workflows/release-singleimage-test.yml index 3d6c0d2b3c..c3a14226ce 100644 --- a/.github/workflows/release-singleimage-test.yml +++ b/.github/workflows/release-singleimage-test.yml @@ -54,7 +54,7 @@ jobs: push: true pull: true platforms: linux/amd64,linux/arm64 - build-args: VERSION=0.0.0+test + build-args: BUDIBASE_VERSION=0.0.0+test tags: budibase/budibase-test:test file: ./hosting/single/Dockerfile.v2 cache-from: type=registry,ref=budibase/budibase-test:test @@ -67,6 +67,6 @@ jobs: platforms: linux/amd64 build-args: | TARGETBUILD=aas - VERSION=0.0.0+test + BUDIBASE_VERSION=0.0.0+test tags: budibase/budibase-test:aas file: ./hosting/single/Dockerfile.v2 diff --git a/hosting/docker-compose.build.yaml b/hosting/docker-compose.build.yaml index 19ce9b5473..7ead001a1c 100644 --- a/hosting/docker-compose.build.yaml +++ b/hosting/docker-compose.build.yaml @@ -8,7 +8,7 @@ services: context: .. dockerfile: packages/server/Dockerfile.v2 args: - - VERSION=0.0.0+dev-docker + - BUDIBASE_VERSION=0.0.0+dev-docker container_name: build-bbapps environment: SELF_HOSTED: 1 @@ -38,7 +38,7 @@ services: context: .. dockerfile: packages/worker/Dockerfile.v2 args: - - VERSION=0.0.0+dev-docker + - BUDIBASE_VERSION=0.0.0+dev-docker container_name: build-bbworker environment: SELF_HOSTED: 1 diff --git a/hosting/single/Dockerfile.v2 b/hosting/single/Dockerfile.v2 index ecc223be15..3b994ce0e6 100644 --- a/hosting/single/Dockerfile.v2 +++ b/hosting/single/Dockerfile.v2 @@ -118,9 +118,9 @@ EXPOSE 443 EXPOSE 2222 VOLUME /data -ARG VERSION -RUN test -n "$VERSION" -ENV VERSION=$VERSION +ARG BUDIBASE_VERSION +RUN test -n "$BUDIBASE_VERSION" +ENV BUDIBASE_VERSION=$VERSION HEALTHCHECK --interval=15s --timeout=15s --start-period=45s CMD "/healthcheck.sh" diff --git a/packages/server/Dockerfile.v2 b/packages/server/Dockerfile.v2 index 339cefcc45..341fe5ee34 100644 --- a/packages/server/Dockerfile.v2 +++ b/packages/server/Dockerfile.v2 @@ -67,9 +67,9 @@ COPY packages/server/docker_run.sh . COPY packages/server/builder/ builder/ COPY packages/server/client/ client/ -ARG VERSION -RUN test -n "$VERSION" -ENV VERSION=$VERSION +ARG BUDIBASE_VERSION +RUN test -n "$BUDIBASE_VERSION" +ENV BUDIBASE_VERSION=$VERSION EXPOSE 4001 diff --git a/packages/server/package.json b/packages/server/package.json index 0636eebe77..4a858f3be9 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -18,7 +18,7 @@ "test": "bash scripts/test.sh", "test:memory": "jest --maxWorkers=2 --logHeapUsage --forceExit", "test:watch": "jest --watch", - "build:docker": "yarn build && docker build . -t app-service --label version=$BUDIBASE_RELEASE_VERSION --build-arg VERSION=$BUDIBASE_RELEASE_VERSION", + "build:docker": "yarn build && docker build . -t app-service --label version=$BUDIBASE_RELEASE_VERSION --build-arg BUDIBASE_VERSION=$BUDIBASE_RELEASE_VERSION", "run:docker": "node dist/index.js", "run:docker:cluster": "pm2-runtime start pm2.config.js", "dev:stack:up": "node scripts/dev/manage.js up", diff --git a/packages/worker/Dockerfile.v2 b/packages/worker/Dockerfile.v2 index 20fcd4a69b..ed3817e89d 100644 --- a/packages/worker/Dockerfile.v2 +++ b/packages/worker/Dockerfile.v2 @@ -50,8 +50,8 @@ ENV POSTHOG_TOKEN=phc_bIjZL7oh2GEUd2vqvTBH8WvrX0fWTFQMs6H5KQxiUxU ENV TENANT_FEATURE_FLAGS=*:LICENSING,*:USER_GROUPS,*:ONBOARDING_TOUR ENV ACCOUNT_PORTAL_URL=https://account.budibase.app -ARG VERSION -RUN test -n "$VERSION" -ENV VERSION=$VERSION +ARG BUDIBASE_VERSION +RUN test -n "$BUDIBASE_VERSION" +ENV BUDIBASE_VERSION=$VERSION CMD ["./docker_run.sh"] diff --git a/packages/worker/package.json b/packages/worker/package.json index 0a75eac522..205bf3309a 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -20,7 +20,7 @@ "run:docker": "node dist/index.js", "debug": "yarn build && node --expose-gc --inspect=9223 dist/index.js", "run:docker:cluster": "pm2-runtime start pm2.config.js", - "build:docker": "yarn build && docker build . -t worker-service --label version=$BUDIBASE_RELEASE_VERSION --build-arg VERSION=$BUDIBASE_RELEASE_VERSION", + "build:docker": "yarn build && docker build . -t worker-service --label version=$BUDIBASE_RELEASE_VERSION --build-arg BUDIBASE_VERSION=$BUDIBASE_RELEASE_VERSION", "dev:stack:init": "node ./scripts/dev/manage.js init", "dev:builder": "npm run dev:stack:init && nodemon", "dev:built": "yarn run dev:stack:init && yarn run run:docker", diff --git a/scripts/build-single-image.sh b/scripts/build-single-image.sh index 216d758fae..ed3d9a8ed6 100755 --- a/scripts/build-single-image.sh +++ b/scripts/build-single-image.sh @@ -1,4 +1,4 @@ #!/bin/bash yarn build --scope @budibase/server --scope @budibase/worker version=$(./scripts/getCurrentVersion.sh) -docker build -f hosting/single/Dockerfile.v2 -t budibase:latest --build-arg VERSION=$version . +docker build -f hosting/single/Dockerfile.v2 -t budibase:latest --build-arg BUDIBASE_VERSION=$version . From 3c16e820354c9b8b9ee03ad8e34ad304fb504d60 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 23 Oct 2023 13:55:23 +0200 Subject: [PATCH 14/17] Comment docker --- hosting/single/Dockerfile.v2 | 1 + packages/server/Dockerfile.v2 | 1 + packages/worker/Dockerfile.v2 | 1 + 3 files changed, 3 insertions(+) diff --git a/hosting/single/Dockerfile.v2 b/hosting/single/Dockerfile.v2 index 3b994ce0e6..66ce0f1c4d 100644 --- a/hosting/single/Dockerfile.v2 +++ b/hosting/single/Dockerfile.v2 @@ -119,6 +119,7 @@ EXPOSE 2222 VOLUME /data ARG BUDIBASE_VERSION +# Ensuring the version argument is sent RUN test -n "$BUDIBASE_VERSION" ENV BUDIBASE_VERSION=$VERSION diff --git a/packages/server/Dockerfile.v2 b/packages/server/Dockerfile.v2 index 341fe5ee34..5035dc748f 100644 --- a/packages/server/Dockerfile.v2 +++ b/packages/server/Dockerfile.v2 @@ -68,6 +68,7 @@ COPY packages/server/builder/ builder/ COPY packages/server/client/ client/ ARG BUDIBASE_VERSION +# Ensuring the version argument is sent RUN test -n "$BUDIBASE_VERSION" ENV BUDIBASE_VERSION=$VERSION diff --git a/packages/worker/Dockerfile.v2 b/packages/worker/Dockerfile.v2 index ed3817e89d..78eba2d3d8 100644 --- a/packages/worker/Dockerfile.v2 +++ b/packages/worker/Dockerfile.v2 @@ -51,6 +51,7 @@ ENV TENANT_FEATURE_FLAGS=*:LICENSING,*:USER_GROUPS,*:ONBOARDING_TOUR ENV ACCOUNT_PORTAL_URL=https://account.budibase.app ARG BUDIBASE_VERSION +# Ensuring the version argument is sent RUN test -n "$BUDIBASE_VERSION" ENV BUDIBASE_VERSION=$VERSION From 3c85f1ce9e4b476062ffc5147f9c1e8bd73fc1f8 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 23 Oct 2023 13:55:58 +0200 Subject: [PATCH 15/17] Fix after renames --- packages/backend-core/src/environment.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend-core/src/environment.ts b/packages/backend-core/src/environment.ts index a0905fb0f5..ed882fe96a 100644 --- a/packages/backend-core/src/environment.ts +++ b/packages/backend-core/src/environment.ts @@ -75,12 +75,12 @@ function getPackageJsonFields(): { const content = readFileSync(packageJsonFile!, "utf-8") const parsedContent = JSON.parse(content) return { - VERSION: process.env.VERSION || parsedContent.version, + VERSION: process.env.BUDIBASE_VERSION || parsedContent.version, SERVICE_NAME: parsedContent.name, } } catch { // throwing an error here is confusing/causes backend-core to be hard to import - return { VERSION: process.env.VERSION || "", SERVICE_NAME: "" } + return { VERSION: process.env.BUDIBASE_VERSION || "", SERVICE_NAME: "" } } } From e3b342da57eac0f62b061f3c089a8f7c8f91bd0a Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 23 Oct 2023 13:57:23 +0200 Subject: [PATCH 16/17] Fix after renames --- hosting/single/Dockerfile.v2 | 2 +- packages/server/Dockerfile.v2 | 2 +- packages/worker/Dockerfile.v2 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hosting/single/Dockerfile.v2 b/hosting/single/Dockerfile.v2 index 66ce0f1c4d..5b07a51b27 100644 --- a/hosting/single/Dockerfile.v2 +++ b/hosting/single/Dockerfile.v2 @@ -121,7 +121,7 @@ VOLUME /data ARG BUDIBASE_VERSION # Ensuring the version argument is sent RUN test -n "$BUDIBASE_VERSION" -ENV BUDIBASE_VERSION=$VERSION +ENV BUDIBASE_VERSION=$BUDIBASE_VERSION HEALTHCHECK --interval=15s --timeout=15s --start-period=45s CMD "/healthcheck.sh" diff --git a/packages/server/Dockerfile.v2 b/packages/server/Dockerfile.v2 index 5035dc748f..881c21299e 100644 --- a/packages/server/Dockerfile.v2 +++ b/packages/server/Dockerfile.v2 @@ -70,7 +70,7 @@ COPY packages/server/client/ client/ ARG BUDIBASE_VERSION # Ensuring the version argument is sent RUN test -n "$BUDIBASE_VERSION" -ENV BUDIBASE_VERSION=$VERSION +ENV BUDIBASE_VERSION=$BUDIBASE_VERSION EXPOSE 4001 diff --git a/packages/worker/Dockerfile.v2 b/packages/worker/Dockerfile.v2 index 78eba2d3d8..a8be432827 100644 --- a/packages/worker/Dockerfile.v2 +++ b/packages/worker/Dockerfile.v2 @@ -53,6 +53,6 @@ ENV ACCOUNT_PORTAL_URL=https://account.budibase.app ARG BUDIBASE_VERSION # Ensuring the version argument is sent RUN test -n "$BUDIBASE_VERSION" -ENV BUDIBASE_VERSION=$VERSION +ENV BUDIBASE_VERSION=$BUDIBASE_VERSION CMD ["./docker_run.sh"] From 453c0744be8d8b3721a2d760d56dcd616d8abf76 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 23 Oct 2023 15:20:44 +0200 Subject: [PATCH 17/17] Fix tests --- packages/server/src/tests/jestEnv.ts | 2 +- packages/worker/src/tests/jestEnv.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/tests/jestEnv.ts b/packages/server/src/tests/jestEnv.ts index c1f32eeec9..4763208c54 100644 --- a/packages/server/src/tests/jestEnv.ts +++ b/packages/server/src/tests/jestEnv.ts @@ -9,4 +9,4 @@ process.env.LOG_LEVEL = process.env.LOG_LEVEL || "error" process.env.MOCK_REDIS = "1" process.env.PLATFORM_URL = "http://localhost:10000" process.env.REDIS_PASSWORD = "budibase" -process.env.VERSION = "0.0.0+jest" +process.env.BUDIBASE_VERSION = "0.0.0+jest" diff --git a/packages/worker/src/tests/jestEnv.ts b/packages/worker/src/tests/jestEnv.ts index f6de4e0fd2..9bd258c43c 100644 --- a/packages/worker/src/tests/jestEnv.ts +++ b/packages/worker/src/tests/jestEnv.ts @@ -10,4 +10,4 @@ process.env.PLATFORM_URL = "http://localhost:10000" process.env.INTERNAL_API_KEY = "tet" process.env.DISABLE_ACCOUNT_PORTAL = "0" process.env.MOCK_REDIS = "1" -process.env.VERSION = "0.0.0+jest" +process.env.BUDIBASE_VERSION = "0.0.0+jest"