1.0.2 • Published 8 years ago

screwdriver-executor-l3l v1.0.2

Weekly downloads
5
License
BSD-3-Clause
Repository
github
Last release
8 years ago

Screwdriver Local Docker-Compose Executor

Version Downloads Build Status Open Issues Dependency Status License

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-l3l

Dependencies

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

ParameterTypeDescription
configObjectConfiguration Object
config.versionStringThe 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:

ParameterTypeDescription
configObjectConfiguration Object
config.buildIdStringThe unique ID for a build
config.containerStringContainer for the build to run in
config.apiUriStringScrewdriver's API
config.tokenStringJWT to act on behalf of the build
callbackFunctionCallback 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/launch with 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:

ParameterTypeDescription
configObjectConfiguration Object
config.buildIdStringThe unique ID for a build
callbackFunctionCallback 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 test

License

Code licensed under the BSD 3-Clause license. See LICENSE file for terms.