Skip to main content

Before Unomi 3, contributors juggled several ad-hoc scripts (buildAndRun.sh, compileDeploy.sh, and friends). UNOMI-887 / #737 folded those workflows into a single ./build.sh at the repository root — with clearer errors, colorized output, and flags that match how people actually work.

build.sh as one hub for preflight, build, test, and deploy

What it replaced

Legacy one-off scripts for “build and run,” “build without tests,” packaging, and deploy were removed in favor of one maintained entry point. The PowerShell twin build.ps1 tracks the same flags for Windows contributors.

What you get

  • Preflight — Java, Maven, GraphViz; memory/disk heuristics; ports for debug sessions; fail early with readable messages
  • Build flexibility — skip tests, OpenSearch vs Elasticsearch, named distributions, offline / Maven debug, optional Javadoc gate
  • Integration tests--integration-tests, --single-test, IT debug/suspend, keep container, stream search logs when needed, memory sampler
  • Run & deploy--deploy --karaf-home, Karaf debug ports, --auto-start for search engines, --no-karaf for package-only builds
  • CI mode--ci is non-interactive, batch Maven (-B -ntp), no Karaf side-trips; GitHub Actions calls the same script as you do locally (#764)
  • UX details — section headers, traps with line/context on failure, NO_COLOR respected, optional --log-file tee

Try it

./build.sh --help

# Default install
./build.sh

# Match GitHub Actions shape
./build.sh --ci

# Full IT matrix flavors
./build.sh --integration-tests
./build.sh --integration-tests --use-opensearch

# One flaky test under a debugger
./build.sh --integration-tests \
  --single-test org.apache.unomi.itests.graphql.GraphQLEventIT \
  --it-debug --it-debug-suspend

# Deploy KAR into an existing Karaf
./build.sh --deploy --karaf-home ~/apache-karaf

Why it matters

Contributor friction kills review velocity. One documented command that validates the environment, builds the right distribution, and runs the same gates as CI means less “works on my machine” archaeology — and pairs with the clearer IT console and manual investments in Unomi 3.

View build.sh on GitHub Manual: using the build script Contribute · Testing

← All posts