diff --git a/package.json b/package.json index e354f36d2a..31e4110a35 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,6 @@ "build:docker:dependencies": "docker build -f hosting/dependencies/Dockerfile -t budibase/dependencies:latest ./hosting", "publish:docker:couch": "docker buildx build --platform linux/arm64,linux/amd64 -f hosting/couchdb/Dockerfile -t budibase/couchdb:latest -t budibase/couchdb:v3.3.3 -t budibase/couchdb:v3.3.3-sqs-v2.1.1 --push ./hosting/couchdb", "publish:docker:dependencies": "docker buildx build --platform linux/arm64,linux/amd64 -f hosting/dependencies/Dockerfile -t budibase/dependencies:latest -t budibase/dependencies:v3.2.1 --push ./hosting", - "release:helm": "node scripts/releaseHelmChart", "env:multi:enable": "lerna run --stream env:multi:enable", "env:multi:disable": "lerna run --stream env:multi:disable", "env:selfhost:enable": "lerna run --stream env:selfhost:enable", diff --git a/scripts/buildx-multiarch.sh b/scripts/buildx-multiarch.sh deleted file mode 100755 index 07a8fdb5c1..0000000000 --- a/scripts/buildx-multiarch.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -sudo apt-get install -y qemu qemu-user-static -docker buildx create --name budibase -docker buildx use budibase diff --git a/scripts/pinVersions.js b/scripts/pinVersions.js deleted file mode 100644 index 44cbba1090..0000000000 --- a/scripts/pinVersions.js +++ /dev/null @@ -1,46 +0,0 @@ -const fs = require("fs") -const path = require("path") - -const MONOREPO_ROOT = "packages" - -const packages = getPackages() - -function getPackages() { - if (fs.existsSync(MONOREPO_ROOT)) { - return fs.readdirSync(MONOREPO_ROOT).map(pkg => path.join(MONOREPO_ROOT, pkg)) - } else { - return ["./"] - } -} - -function pinDeps(dependencies) { - for (let dependency in dependencies) { - if (dependency.startsWith("@budibase")) { - dependencies[dependency] = dependencies[dependency].replace("^", "") - } - } - return dependencies -} - -// iterate over the monorepo packages -for (let pkgPath of packages) { - // only directories - if (fs.statSync(pkgPath).isDirectory()) { - // get the package JSON file - const pkgJsonPath = path.join(pkgPath, "package.json") - if (!fs.existsSync(pkgJsonPath)) { - continue - } - const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath)) - - - // find any budibase dependencies, and pin them - pkgJson.dependencies = pinDeps(pkgJson.dependencies) - pkgJson.devDependencies = pinDeps(pkgJson.devDependencies) - - // update the package JSON files - fs.writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2)) - } -} - -console.log("Pinned dev versions for budibase packages successfully.") diff --git a/scripts/releaseHelmChart.js b/scripts/releaseHelmChart.js deleted file mode 100755 index 45ae01df0e..0000000000 --- a/scripts/releaseHelmChart.js +++ /dev/null @@ -1,28 +0,0 @@ -const yaml = require("js-yaml") -const fs = require("fs") -const path = require("path") - -const CHART_PATH = path.join(__dirname, "../", "charts", "budibase", "Chart.yaml") -const UPGRADE_VERSION = process.env.BUDIBASE_RELEASE_VERSION - -if (!UPGRADE_VERSION) { - throw new Error("BUDIBASE_RELEASE_VERSION env var must be set.") -} - -try { - const chartFile = fs.readFileSync(CHART_PATH, "utf-8") - const chart = yaml.load(chartFile) - - // Upgrade app version in chart to match budibase release version - chart.appVersion = UPGRADE_VERSION - - // semantically version the chart - const [major, minor, patch] = chart.version.split(".") - const newPatch = parseInt(patch) + 1 - chart.version = [major, minor, newPatch].join(".") - const updatedChartYaml = yaml.dump(chart) - fs.writeFileSync(CHART_PATH, updatedChartYaml) -} catch (err) { - console.error("Error releasing helm chart") - throw err -} diff --git a/scripts/resetVersions.sh b/scripts/resetVersions.sh deleted file mode 100755 index 83411f5153..0000000000 --- a/scripts/resetVersions.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/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/syncLocalDependencies.js b/scripts/syncLocalDependencies.js deleted file mode 100755 index 1c402e9a44..0000000000 --- a/scripts/syncLocalDependencies.js +++ /dev/null @@ -1,60 +0,0 @@ -const fs = require("fs") -const path = require("path") -const { execSync } = require("child_process") - -// Get the version argument from the command line -const version = process.argv[2] -if (!version) { - console.error("Usage: node update-workspace-dependencies.js ") - process.exit(1) -} - -// Get the list of workspaces with mismatched dependencies -const output = execSync("yarn --silent workspaces info --json", { - encoding: "utf-8", -}) -const data = JSON.parse(output) - -const workspaces = Object.keys(data).filter(key => { - return data[key].mismatchedWorkspaceDependencies?.length -}) - -// Loop through each workspace and update the dependencies -workspaces.forEach(workspace => { - const dependencies = data[workspace].mismatchedWorkspaceDependencies - - // Loop through each dependency and update its version in package.json - const packageJsonPath = path.join(data[workspace].location, "package.json") - const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8")) - let hasChanges = false - - dependencies.forEach(dependency => { - if (packageJson.dependencies?.[dependency]) { - packageJson.dependencies[dependency] = version - hasChanges = true - } - if (packageJson.devDependencies?.[dependency]) { - packageJson.devDependencies[dependency] = version - hasChanges = true - } - if (packageJson.peerDependencies?.[dependency]) { - packageJson.peerDependencies[dependency] = version - hasChanges = true - } - }) - - // Write changes to package.json if there are any - if (hasChanges) { - fs.writeFileSync( - packageJsonPath, - JSON.stringify(packageJson, null, 2) + "\n" - ) - } -}) - -const rootPackageJson = JSON.parse(fs.readFileSync("package.json", "utf-8")) -delete rootPackageJson["resolutions"] -fs.writeFileSync( - "package.json", - JSON.stringify(rootPackageJson, null, 2) + "\n" -) diff --git a/scripts/updateVersions.sh b/scripts/updateVersions.sh deleted file mode 100755 index 1d019fd886..0000000000 --- a/scripts/updateVersions.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -version=$(./scripts/getCurrentVersion.sh) -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