This document describes the development tools and scripts available in the utils/ directory.
- Overview
- Thrift Compilation Scripts
- Documentation Generation
- Development Tools
- Code Generation
- Testing Tools
- Bundled Tools
The utils/ directory contains scripts and tools that support Concourse development:
utils/
├── compile-thrift-*.sh # Thrift compilation scripts
├── generate-*-docs.sh # Documentation generators
├── install-git-hooks.sh # Git hooks installer
├── install-snapshot.sh # Snapshot installer
├── build-ete-test-plugin.sh # Test plugin builder
├── run-bash-tests.sh # Bash test runner
├── codegen/ # Code generation scripts
├── bats/ # Bash testing framework
├── ronn/ # Manual page generator
├── jq/ # JSON processor
├── fpm/ # Package builder
└── apidoc/ # API documentation config
These scripts compile the Thrift IDL files in interface/ to generate client/server code for various languages.
Compiles Thrift interfaces for all supported languages.
./utils/compile-thrift-all.shWhen to use: After modifying any .thrift file in interface/.
Compiles Thrift interfaces for Java only.
./utils/compile-thrift-java.shOutput: Generated Java files in concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/
When to use: When only Java bindings need to be regenerated.
Compiles Thrift interfaces for Python.
./utils/compile-thrift-python.shOutput: Generated Python files in concourse-driver-python/concourse/thriftapi/
Compiles Thrift interfaces for PHP.
./utils/compile-thrift-php.shOutput: Generated PHP files in concourse-driver-php/src/
Compiles Thrift interfaces for Ruby.
./utils/compile-thrift-ruby.shOutput: Generated Ruby files in concourse-driver-ruby/lib/
These scripts require the Apache Thrift compiler:
# macOS
brew install thrift
# Ubuntu/Debian
apt-get install thrift-compiler
# Verify installation
thrift --versionGenerates documentation for the CaSH (Concourse Shell) commands.
./utils/generate-cash-docs.shOutput: Shell command documentation in docs/shell/
How it works:
- Extracts method signatures from the Concourse API
- Uses ronn to generate man pages and HTML documentation
Generates API documentation for the Java driver.
./utils/generate-driver-docs.shOutput: JavaDoc in concourse-driver-java/build/docs/javadoc/
Generates REST API documentation.
./utils/generate-rest-api-docs.shOutput: API documentation based on the configuration in utils/apidoc/apidoc.json
Installs Git hooks for the repository.
./utils/install-git-hooks.shInstalled hooks:
pre-push: Runs code formatting checks before pushing
When to use: Once, after cloning the repository.
Installs a snapshot build of Concourse to your local system.
./utils/install-snapshot.shWhat it does:
- Builds the installer from source
- Installs to a local directory
- Useful for testing local changes
Builds test plugins for end-to-end testing of the plugin framework.
./utils/build-ete-test-plugin.sh [java_version]Arguments:
java_version(optional): Target Java version (8, 11, 17, 21)
Output: Plugin ZIP files in concourse-server/src/test/resources/plugins/
When to use: When testing plugin framework changes across Java versions.
A Groovy script that generates stateful service wrappers.
groovy utils/codegen/StatefulConcourseServiceGenerator.groovyPurpose: Generates wrapper classes that maintain state across Thrift service calls.
When to use: After modifying the Thrift service interface when stateful tracking is needed.
Runs bash-based tests using the BATS framework.
./utils/run-bash-tests.sh [test_file]Arguments:
test_file(optional): Specific test file to run
Example:
# Run all bash tests
./utils/run-bash-tests.sh
# Run specific test file
./utils/run-bash-tests.sh concourse-bash-tests/post_install/install.batsThe Bash Automated Testing System (BATS) framework for testing shell scripts.
Location: utils/bats/
Usage: Tests are defined in .bats files:
#!/usr/bin/env bats
@test "concourse starts successfully" {
run concourse start
[ "$status" -eq 0 ]
}
@test "concourse shell connects" {
run concourse shell --password admin -e "ping()"
[ "$status" -eq 0 ]
[[ "$output" == *"true"* ]]
}Running BATS tests:
./utils/bats/bin/bats path/to/test.batsA Ruby-based tool for generating manual pages from Markdown.
Location: utils/ronn/
Usage:
./utils/ronn/bin/ronn --roff --html docs/shell/add.ronnInput: .ronn files (extended Markdown)
Output: Man pages (.1, .7) and HTML files
Example .ronn file:
add(1) -- Add a value to a key in a record
=============================================
## SYNOPSIS
`add` <key>, <value>, <record>
## DESCRIPTION
Adds the specified **value** to the **key** in **record** if
the mapping does not already exist.
## RETURN VALUE
Returns `true` if the value is added, `false` otherwise.Pre-compiled jq binaries for JSON processing.
Location: utils/jq/
Available binaries:
jq-osx-amd64- macOS (Intel)jq-linux64- Linux (64-bit)
Helper script: utils/jq/jq.sh - Selects the appropriate binary
Usage:
# Parse JSON output
echo '{"name":"test"}' | ./utils/jq/jq.sh '.name'Effing Package Management - tool for creating system packages.
Location: utils/fpm/
Purpose: Used in the build process to create distribution packages (.deb, .rpm, etc.)
Usage (typically automated in Gradle):
./utils/fpm/bin/fpm -s dir -t deb -n concourse ...Configuration for API documentation generation.
Location: utils/apidoc/
Files:
apidoc.json- Configuration for the apidoc tool
Configuration example:
{
"name": "Concourse REST API",
"version": "0.12.0",
"description": "RESTful API for Concourse",
"title": "Concourse API Documentation"
}# Regenerate all language bindings
./utils/compile-thrift-all.sh
# Or just Java
./utils/compile-thrift-java.sh# Install git hooks
./utils/install-git-hooks.sh
# Build and install locally
./utils/install-snapshot.sh# Shell docs
./utils/generate-cash-docs.sh
# API docs
./utils/generate-driver-docs.sh
./utils/generate-rest-api-docs.sh# All tests
./utils/run-bash-tests.sh
# Specific file
./utils/run-bash-tests.sh concourse-bash-tests/post_install/install.bats| Script | Requires |
|---|---|
compile-thrift-*.sh |
Apache Thrift compiler |
generate-cash-docs.sh |
Ruby, ronn |
generate-driver-docs.sh |
Java, Gradle |
run-bash-tests.sh |
Bash, bats |
build-ete-test-plugin.sh |
Java, Gradle, Docker (optional) |
- Developer Guide - Development workflow
- Testing Guide - Test frameworks
- Contributing Guidelines - How to contribute