Fix build scripts so a failure returns a nonzero exit code
This commit is contained in:
parent
de5d02da00
commit
5ca6b3fafa
|
|
@ -1,17 +1,20 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Switch to the correct branch
|
||||||
if [[ -z "${CF_PAGES_BRANCH}" ]]; then
|
if [[ -z "${CF_PAGES_BRANCH}" ]]; then
|
||||||
git switch master || git switch -c unknown-branch
|
git switch master || git switch -c unknown-branch
|
||||||
else
|
else
|
||||||
git switch $CF_PAGES_BRANCH || git switch -c $CF_PAGES_BRANCH
|
git switch $CF_PAGES_BRANCH || git switch -c $CF_PAGES_BRANCH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Install the latest version of the Rust toolchain
|
||||||
echo 🔧 Install Rust
|
echo 🔧 Install Rust
|
||||||
curl https://sh.rustup.rs -sSf | sh -s -- -y
|
curl https://sh.rustup.rs -sSf | sh -s -- -y
|
||||||
export PATH=$PATH:/opt/buildhome/.cargo/bin
|
export PATH=$PATH:/opt/buildhome/.cargo/bin
|
||||||
echo rustc version:
|
echo rustc version:
|
||||||
rustc --version
|
rustc --version
|
||||||
|
|
||||||
|
# Install the project's Node dependencies through npm
|
||||||
echo 🚧 Install Node dependencies
|
echo 🚧 Install Node dependencies
|
||||||
echo node version:
|
echo node version:
|
||||||
node --version
|
node --version
|
||||||
|
|
@ -20,9 +23,11 @@ npm --version
|
||||||
cd frontend
|
cd frontend
|
||||||
npm ci
|
npm ci
|
||||||
|
|
||||||
|
# Install the cargo-about Rust dependency that's used during the Webpack build process (in `vue.config.js`)
|
||||||
echo 📦 Install cargo-about
|
echo 📦 Install cargo-about
|
||||||
cargo install cargo-about
|
cargo install cargo-about
|
||||||
|
|
||||||
|
# Build for production
|
||||||
echo 👷 Build Graphite web client
|
echo 👷 Build Graphite web client
|
||||||
export NODE_ENV=production
|
export NODE_ENV=production
|
||||||
npm run build
|
npm run build
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ accepted = [
|
||||||
]
|
]
|
||||||
ignore-build-dependencies = true
|
ignore-build-dependencies = true
|
||||||
ignore-dev-dependencies = true
|
ignore-dev-dependencies = true
|
||||||
|
|
||||||
workarounds = ["ring"]
|
workarounds = ["ring"]
|
||||||
|
|
||||||
# https://raw.githubusercontent.com/briansmith/webpki/main/LICENSE
|
# https://raw.githubusercontent.com/briansmith/webpki/main/LICENSE
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,19 @@
|
||||||
{
|
{
|
||||||
"name": "graphite-web-frontend",
|
"name": "graphite-web-frontend",
|
||||||
"description": "Graphite's web app frontend. Planned to be replaced by a native GUI written in Rust in the future.",
|
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"description": "Graphite's web app frontend. Planned to be replaced by a native GUI written in Rust in the future.",
|
||||||
"start": "vue-cli-service serve",
|
|
||||||
"serve": "vue-cli-service serve || echo 'Graphite project failed to build. Did you remember to `npm install` the dependencies?'",
|
|
||||||
"build": "vue-cli-service build || echo 'Graphite project failed to build. Did you remember to `npm install` the dependencies?'",
|
|
||||||
"lint": "vue-cli-service lint || echo 'Graphite project had lint errors or otherwise failed. In the latter case, did you remember to `npm install` the dependencies?'",
|
|
||||||
"lint-no-fix": "vue-cli-service lint --no-fix || echo 'Graphite project had lint errors or otherwise failed. In the latter case, did you remember to `npm install` the dependencies?'",
|
|
||||||
"tauri:build": "vue-cli-service tauri:build",
|
|
||||||
"tauri:serve": "vue-cli-service tauri:serve"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/GraphiteEditor/Graphite.git"
|
|
||||||
},
|
|
||||||
"author": "Graphite Authors <contact@graphite.rs>",
|
"author": "Graphite Authors <contact@graphite.rs>",
|
||||||
"license": "Apache-2.0",
|
"scripts": {
|
||||||
"homepage": "https://graphite.rs",
|
"start": "npm run serve",
|
||||||
|
"serve": "vue-cli-service serve || (npm run print-building-help && exit 1)",
|
||||||
|
"build": "vue-cli-service build || (npm run print-building-help && exit 1)",
|
||||||
|
"lint": "vue-cli-service lint || (npm run print-linting-help && exit 1)",
|
||||||
|
"lint-no-fix": "vue-cli-service lint --no-fix || (npm run print-linting-help && exit 1)",
|
||||||
|
"tauri:build": "vue-cli-service tauri:build",
|
||||||
|
"tauri:serve": "vue-cli-service tauri:serve",
|
||||||
|
"print-building-help": "echo 'Graphite project failed to build. Did you remember to `npm install` the dependencies in `/frontend`?'",
|
||||||
|
"print-linting-help": "echo 'Graphite project had lint errors, or may have otherwise failed. In the latter case, did you remember to `npm install` the dependencies in `/frontend`?'"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": "^1.2.0",
|
"@tauri-apps/api": "^1.2.0",
|
||||||
"class-transformer": "^0.5.1",
|
"class-transformer": "^0.5.1",
|
||||||
|
|
@ -49,8 +45,14 @@
|
||||||
"vue-loader": "^17.0.1",
|
"vue-loader": "^17.0.1",
|
||||||
"vue-template-compiler": "^2.7.14"
|
"vue-template-compiler": "^2.7.14"
|
||||||
},
|
},
|
||||||
|
"//": "Notes about dependency issues and incompatibilities should be added here when needed.",
|
||||||
|
"homepage": "https://graphite.rs",
|
||||||
|
"license": "Apache-2.0",
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"wasm-pack": "^0.10.3"
|
"wasm-pack": "^0.10.3"
|
||||||
},
|
},
|
||||||
"//": "Notes about dependency issues and incompatibilities should be added here when needed."
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/GraphiteEditor/Graphite.git"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -85,11 +85,17 @@ function formatThirdPartyLicenses(jsLicenses) {
|
||||||
|
|
||||||
if (rustLicenses === undefined) {
|
if (rustLicenses === undefined) {
|
||||||
// This is probably caused by cargo about not being installed
|
// This is probably caused by cargo about not being installed
|
||||||
console.error(`
|
console.error(
|
||||||
Could not run \`cargo about\`, which is required to generate license information.
|
`
|
||||||
To install cargo-about on your system, you can run:
|
Could not run \`cargo about\`, which is required to generate license information.
|
||||||
cargo install cargo-about
|
To install cargo-about on your system, you can run \`cargo install cargo-about\`.
|
||||||
License information is required on production builds. Aborting.`);
|
License information is required on production builds. Aborting.
|
||||||
|
`
|
||||||
|
.trim()
|
||||||
|
.split("\n")
|
||||||
|
.map((line) => line.trim())
|
||||||
|
.join("\n")
|
||||||
|
);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue