1.0.5 • Published 8 years ago

screwdriver-executor-j5s v1.0.5

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

Screwdriver Jenkins Executor

Version Downloads Build Status Open Issues Dependency Status License

This executor plugin extends the executor-base-class, and provides methods to start jobs from Jenkins

Usage

npm install screwdriver-executor-j5s

Configure

The class provides a couple options that are configurable in the instantiation of this Executor

ParameterTypeDescription
configObjectConfiguration Object
config.usernameStringThe username for Jenkins cluster
config.passwordStringThe password or token for Jenkins cluster
config.hostStringThe hostname for the Jenkins cluster

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 fn(err) for when job has been created

The start function will start a job in Jenkins with labels for easy lookup. These labels are:

  • sdbuild: config.buildId

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 parameters required are:

ParameterTypeDescription
configObjectConfiguration Object
config.buildIdStringThe unique ID for a build to be stopped
callbackFunctionCallback fn(err) for when the build has been stopped

The stop function will stop last build of the job with the buildId tag in jenkins.

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.