Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rundeck: Pull job definition from GitHub with SCM plugin

Tags:

git

rundeck

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?

like image 779
David H Avatar asked Mar 28 '16 16:03

David H


3 Answers

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

like image 136
Greg Schueler Avatar answered Nov 15 '22 04:11

Greg Schueler


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
like image 37
Shobha Deepthi Avatar answered Nov 15 '22 05:11

Shobha Deepthi


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.

like image 27
Leo Prince Avatar answered Nov 15 '22 04:11

Leo Prince