Fix build scripts so a failure returns a nonzero exit code

This commit is contained in:
Keavon Chambers
2023-01-02 22:04:13 -08:00
parent de5d02da00
commit 5ca6b3fafa
4 changed files with 35 additions and 23 deletions
+5
View File
@@ -1,17 +1,20 @@
#!/bin/sh
# Switch to the correct branch
if [[ -z "${CF_PAGES_BRANCH}" ]]; then
git switch master || git switch -c unknown-branch
else
git switch $CF_PAGES_BRANCH || git switch -c $CF_PAGES_BRANCH
fi
# Install the latest version of the Rust toolchain
echo 🔧 Install Rust
curl https://sh.rustup.rs -sSf | sh -s -- -y
export PATH=$PATH:/opt/buildhome/.cargo/bin
echo rustc version:
rustc --version
# Install the project's Node dependencies through npm
echo 🚧 Install Node dependencies
echo node version:
node --version
@@ -20,9 +23,11 @@ npm --version
cd frontend
npm ci
# Install the cargo-about Rust dependency that's used during the Webpack build process (in `vue.config.js`)
echo 📦 Install cargo-about
cargo install cargo-about
# Build for production
echo 👷 Build Graphite web client
export NODE_ENV=production
npm run build