JobKit
JavaScript Job Runner
JobKit allows you to write job scripts in javascript and run it via jobkit
cli or using jobkit-server triggered by git poll.
JobKit runs your job scripts in a docker container and remove it after it ends.
Installation
Globally:
npm install -g jobkit
Locally:
npm install --save-dev jobkit
Job file
Create a job file such as test.js
:
moduleexports = async { const mongo = await docker await mongostart await await git await npm await await npm await await npm await mongo await mongo}
Running
jobkit test.js
Add parameters
jobkit test.js -p foo=1 -p bar=hello
You can read these parameters in your job file via params
attribute:
module console
Set environment variables
jobkit test.js -e FOO=1 -e BAR=hello
That will set these environment variables to the job process:
module console