Clean unused scripts

This commit is contained in:
Adria Navarro 2024-11-28 13:42:54 +01:00
parent 525b6f84bb
commit 88773d1e6c
7 changed files with 0 additions and 154 deletions

View File

@ -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",

View File

@ -1,4 +0,0 @@
#!/bin/bash
sudo apt-get install -y qemu qemu-user-static
docker buildx create --name budibase
docker buildx use budibase

View File

@ -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.")

View File

@ -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
}

View File

@ -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!"

View File

@ -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 <version>")
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"
)

View File

@ -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