Michael J
Michael J

Reputation: 1543

Export Jenkins User Account and Security Settings?

I'm working with Jenkins servers in three different environments:Development-Staging-Production.

We work out the kinks in our Jenkins jobs in dev, test them in stage, and then finally move them to production. We do that be either replicating the job in the GUI (cut and paste) or tarring up the job directory and moving it to the next environment via the command line.

I'm wondering if the move option can be done with the service accounts that run these jobs. I can see the user account directories and config files under /var/lib/jenkins/users. What I don't see are the security settings that get applied to the user from the "Configure Global Security" screen in the GUI.

For these service accounts, we have the minimal authorization of READ on Global and READ and BUILD on Jobs.

What I'd like to be able to do is prove a service account in dev and then promote it to Stage and Prod from the command line vs having to manually recreate the account in the GUI for each upstream environment. If the API key could also be moved along with it that would be great.

Any thoughts or ideas?

Upvotes: 3

Views: 7359

Answers (2)

Morfic
Morfic

Reputation: 15498

Just a wild thought, but why not use a master-slave config and trigger builds on the desired remote machine based on some "environment" parameter. You can also look through the plugins section to see if you can find something useful such as the:

  • node label parameter which allows to define and select the label for the node where you want the build to run
  • copy to slave that facilitates copying files to and from a slave

That way you'll only have one job configuration which can be executed on different environments without too much hustle.

Upvotes: 0

Slav
Slav

Reputation: 27485

User permissions are in config.xml under the Jenkins root folder, in section <authorizationStrategy>

This file contains other global settings, so just copying it would not be advisable

Upvotes: 1

Related Questions