Concourse Shell#
The concourse shell
is a built-in interface to interact with Concourse. The concourse shell
is backed by the full power of the Groovy scripting language, so you can use it to dynamically query and update data.
Most examples in the Concourse Guide use concourse shell
. Most client drivers also provide a similar interface to Concourse.
Starting concourse shell
#
Warning
Make sure that Concourse is running before attempting to start concourse shell.
To start concourse shell
and connect to the Concourse instance running on localhost with the default port into the default environment:
- At a prompt in a terminal window:
1
concourse shell
Changing connection parameters#
You can connect to a different environment or a Concourse instance running on a different server and/or a different port by specifying any combination of the the following command line options:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
Working with the concourse shell
#
Ad hoc commands#
Run Commands File#
You can use a run commands
file to seed the shell with a script that is run before the prompt is displayed for the first time. By default, concourse shell
checks the user’s HOME directory for a groovy file named .cashrc
.
Alternatively, you can specify a different run-commands
file by starting concourse shell using the --run-commands
or -rc
option:
1 |
|
Usage#
Using a run commands
file allows you to automatically seed each concourse shell session with common configuration.
NOTE: The script can access all the standard variables and methods defined in the shell’s environment.
Startup Commands#
Custom Functions#
You can define custom functions in the run commands
file using standard groovy syntax. Custom functions are added to the shell’s namespace so they can be invoked by the interpreter; however they are not run on startup.
- For example, create a function to display all the keys across all records in Concourse:
1 2 3 4 5 6 7 8 9 10 |
|
- Launch concourse shell and invoke the function:
1 2 |
|