From e90d40c0be5aa16dd893b9528e6bedb7ecec6cc9 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 18 Apr 2024 10:49:22 +0200 Subject: [PATCH 1/3] Add all scripts as nx cache inputs --- nx.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/nx.json b/nx.json index 618395ec90..8ba8798946 100644 --- a/nx.json +++ b/nx.json @@ -9,10 +9,7 @@ }, "targetDefaults": { "build": { - "inputs": [ - "{workspaceRoot}/scripts/build.js", - "{workspaceRoot}/lerna.json" - ] + "inputs": ["{workspaceRoot}/scripts/*", "{workspaceRoot}/lerna.json"] } } } From 8e2fb778233a9b8a3d7373655f80db2cd0968c81 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 18 Apr 2024 10:53:23 +0200 Subject: [PATCH 2/3] Prevent dev:docker running for oss --- package.json | 2 +- scripts/devDocker.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 scripts/devDocker.sh diff --git a/package.json b/package.json index e520b7c2cf..e60a086e17 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "dev:camunda": "./scripts/deploy-camunda.sh", "dev:all": "yarn run kill-all && lerna run --stream dev", "dev:built": "yarn run kill-all && cd packages/server && yarn dev:stack:up && cd ../../ && lerna run --stream dev:built", - "dev:docker": "yarn build --scope @budibase/server --scope @budibase/worker && docker-compose -f hosting/docker-compose.build.yaml -f hosting/docker-compose.dev.yaml --env-file hosting/.env up --build --scale proxy-service=0", + "dev:docker": "./scripts/devDocker.sh", "test": "REUSE_CONTAINERS=1 lerna run --concurrency 1 --stream test --stream", "lint:eslint": "eslint packages --max-warnings=0", "lint:prettier": "prettier --check \"packages/**/*.{js,ts,svelte}\" && prettier --write \"examples/**/*.{js,ts,svelte}\"", diff --git a/scripts/devDocker.sh b/scripts/devDocker.sh new file mode 100755 index 0000000000..3d454bafb5 --- /dev/null +++ b/scripts/devDocker.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Check if the pro submodule is loaded +if [ ! -d "./packages/pro/src" ]; then + echo "Submodule is not loaded. This is only allowed with loaded submodules." + exit 1 +fi + +yarn build --scope @budibase/server --scope @budibase/worker +docker-compose -f hosting/docker-compose.build.yaml -f hosting/docker-compose.dev.yaml --env-file hosting/.env up --build --scale proxy-service=0 + + From ccbbb2e1ee278a556543c32a4812c02dce06a5f4 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 18 Apr 2024 10:53:58 +0200 Subject: [PATCH 3/3] Add message --- scripts/devDocker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/devDocker.sh b/scripts/devDocker.sh index 3d454bafb5..5e01e5813a 100755 --- a/scripts/devDocker.sh +++ b/scripts/devDocker.sh @@ -2,7 +2,7 @@ # Check if the pro submodule is loaded if [ ! -d "./packages/pro/src" ]; then - echo "Submodule is not loaded. This is only allowed with loaded submodules." + echo "[ERROR] Submodule is not loaded. This is only allowed with loaded submodules." exit 1 fi