Script to create rundeck job

578 views
Skip to first unread message

Dave Ruffin

unread,
Sep 1, 2017, 11:01:36 PM9/1/17
to rundeck-discuss
Is there a way to create a rundeck job from the command line, rest api, etc.?

Ideally i would like to script a way to create a rundeck job as opposed to using the gui to create one.

Alex Honor

unread,
Sep 1, 2017, 11:27:13 PM9/1/17
to rundeck...@googlegroups.com
Hi Dave,

Yes you can generate a job definition as a text file and use the REST API to import it.

Here's the related doc:



On Thu, Aug 31, 2017 at 2:37 PM, Dave Ruffin <d.ru...@405network.com> wrote:
Is there a way to create a rundeck job from the command line, rest api, etc.?

Ideally i would like to script a way to create a rundeck job as opposed to using the gui to create one.

--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to rundeck-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/a14bf7d1-7a4b-4785-8617-1d262443ad5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Alex Honor

[Rundeck | a...@rundeck.com ]

grant donovan

unread,
Sep 2, 2017, 2:44:42 PM9/2/17
to rundeck-discuss
Over the last week or so I have been working on the following using the api

Create project
Create Jobs
Update jobs

I use bash as the scripting language

I store details about projects and job structure in json

What happens is that I loop through all the projects in my json file, and the create jobs (or update if they already exist) for that project.  So if I have 2 projects in the json file and 5 jobs, I would have 2 projects created (or not touched) and 10 jobs created or updated.  This uses the api.

The jobs define the action, for example deploy to staging for that project (project values are taken from the project json file)

What this means is that I can manage all the projects and jobs in separate file

This is still a work in progress, but I would be happy to share if you give me a few days (and would be useful)

Thanks

Grant
Reply all
Reply to author
Forward
0 new messages