Rundeck: Pull job definition from GitHub with SCM plugin
Asked Answered
S

3

5

I would very much like to import/export my rundeck job descriptions (YAML) to/from a GitHub repository.

It seems the SCM plugin for rundeck (2.6.4) is ready, but I can find very little documentation on how to use it.

When I attempt to configure it in the "Setup SCM Plugin: Git Export" screen, I get the following error:

Failed fetch from the repository:  
https://github.com/OptionMetrics/Rundeck.git: Authentication is required but no CredentialsProvider has been registered

I've tried creating an SSH key, uploading it to GitHub, and storing it in the rundeck Key Storage. I've then referenced this key from the configuration page. No luck.

Can anyone give me clear instructions on how to make this work?

Sidelong answered 28/3, 2016 at 16:3 Comment(0)
R
6

You can use the SSH key storage, but you need to set your git URL to the SSH url provided on github. Instead of https://github.com/OptionMetrics... it would be [email protected]:OptionMetrics...

if you want to use https, you can specify a username/password. You need to generate a "personal access token" via github, and use that as your password

Radiosensitive answered 30/3, 2016 at 16:24 Comment(0)
S
2

You need to add credentials to github. For that go to Github -> Profile -> Settings - > Developer Settings -> Personal access tokens Copy the above password. Now come back to Rundeck -> Settings -> Key Storage -> Add or Upload Key. Key Type is Password , Copy paste the password in "Enter text". Give a name to the key. The same will be available in the SCM Setup Configuration page under Password Storage Path when you click Select.

You can use https to connect to git from rundeck, you may want to replace with your settings whatever is mentioned within <> brackets.

Export Jobs to a Git Repository More…
Committer Name: <Commiter Name>
Committer Email: <Commiter Email ID>
Export UUID Behavior: preserve
Synchronize Automatically: false
Base branch on: master
File Path Template: ${job.group}${job.name}-${job.id}.${config.format}
Base Directory: <Base Directory >
Git URL: https://<userid>@github5.<domain>.com/<project>.git/
Branch: master
SSH: Strict Host Key Checking: no
Password Storage Path: keys/Github
Format: xml
Fetch Automatically: false
Satirist answered 31/3, 2020 at 8:7 Comment(0)
E
1

It seems an issue with the github authentication. I was able to get it work with rundeck-git-plugin-2.6.1.jar and private git repo.

First you test whether you can clone the git repository as "rundeck" user from the rundeck host, if it works without any issues, you wouldn't have any issues with setting up the plugin and there for committing/pushing the job yml files to repo.

git authentication between rundeck user and git repository is the only thing important while using this plugin. Also use SSH method of repo endpoint to clone if you are using the SSH key based authentication.

Emelineemelita answered 30/3, 2016 at 13:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.