screwdriver-executor-l3l v1.0.2
Screwdriver Local Docker-Compose Executor
Local Docker-Compose Executor plugin for Screwdriver
This executor plugin extends the executor-base-class, and provides methods to start and stop jobs via docker-compose running on the same host
Usage
npm install screwdriver-executor-l3lDependencies
This plugin requires docker-compose to be installed on the same system running the executor plugin.
Configure
The class provides a couple options that are configurable in the instantiation of this Executor
| Parameter | Type | Description |
|---|---|---|
| config | Object | Configuration Object |
| config.version | String | The Docker tag to use for the screwdriver job-tools container (optional defaults to latest) |
Start
The start method takes advantage of the input validation defined in the executor-base-class.
The parameters required are:
| Parameter | Type | Description |
|---|---|---|
| config | Object | Configuration Object |
| config.buildId | String | The unique ID for a build |
| config.container | String | Container for the build to run in |
| config.apiUri | String | Screwdriver's API |
| config.token | String | JWT to act on behalf of the build |
| callback | Function | Callback for when task has been created |
The start function will start a job locally using docker-compose.
The job runs two containers:
- Runs the screwdriver job-tools container, sharing the files in
/opt/screwdriver - Runs the specified container, which runs
/opt/screwdriver/launchwith the required parameters
The callback is called with:
- An error
callback(err)when an error occurs starting the job - null
callback(null)when a job is correctly started
Stop
The stop method takes advantage of the input validation defined in the executor-base-class.
The parameters required are:
| Parameter | Type | Description |
|---|---|---|
| config | Object | Configuration Object |
| config.buildId | String | The unique ID for a build |
| callback | Function | Callback for when the job has been stopped |
The callback is called with:
- An error
callback(err)when an error occurs stopping the job - null
callback(null)when a job is correctly stopped
Testing
npm testLicense
Code licensed under the BSD 3-Clause license. See LICENSE file for terms.