rundeck-job-proxy
v1.1.1
Published
Proxy server for Rundeck job executions. Converts the request's JSON payload to job arguments (e.g. Gitlab & Github)
Downloads
10
Maintainers
Readme
Rundeck job proxy
Proxy server for Rundeck job executions. Converts the request's JSON payload to job arguments (e.g. Gitlab & Github).
Usage
To start the server run:
rundeck-job-proxy$ bin/rundeck-job-proxy.sh config.json
Calling the server with a URL parameter job will reroute to <BACKEND_URL>/api/<VERSION>/executions/<JOB>
For configuration options, see Configuration.
To create a system startup script use pm2. Start the server and run pm2 startup
nginx
# Rundeck
location / {
proxy_pass http://localhost:4440;
}
# Rundeck job proxy
location /run-job/ {
proxy_pass http://localhost:1337;
}
Configuration
Following configuration options are available:
- port: Proxy server port. Defaults to 1337.
- version: Rundeck API version to use. Defaults to 14.
- backend: Rundeck server URL. Defaults to http://localhost:4440.
- map: A mapping of JSON payload properties to job options. Property names represents the option name. The values are arrays which represent the property hierarchy of the mapped value. Defaults to {}.
- filter: An object representing JSON payload properties and their values. If one of these properties does not exist in the payload or has a different value the request is not passed to the backend (HTTP status code 400 is returned). Values are compared with the strict equality operators (===).
Example configuration
{
"port": 1337,
"version": "14"
"backend": "http://localhost:4440",
"map": {
"foo": ["foo", "bar"]
}
}
For example payload
{
"foo": {
"bar": "fubar"
}
}
Of URL
https://rundeck.foo.bar/api/14/executions?job=foo&authtoken=bar
Becomes
https://rundeck.foo.bar/api/14/executions/foo?authtoken=bar
And payload
{
"argString": "-foo \"fubar\""
}
Development
Clone the sources and install the package using npm
:
npm install
Run the following NPM script to lint, test and check coverage of the code:
npm run check
License and copyright
Copyright (c) 2016 University Of Helsinki (The National Library Of Finland)
This project's source code is licensed under the terms of GNU Affero General Public License Version 3 or any later version.