1

Is there a way to add global tool configurations for artifactory and aws in jenkins through cli?

I'm trying to write chef cookbook for automating creation of Jenkins job, but I don't know how to add credentials for tools.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Nithees balaji
  • 148
  • 1
  • 11

2 Answers2

0

Credentials don't depend on the tools which will use them.
You can register credentials in general through the JENKINS Credentials Plugin API: see for instance

You can then use those credentials in association with a Jenkins Job.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

Your question is twofold.

Credentials

The Jenkins chef cookbook offers a jenkins_credentials resource, which allows you to pipe credentials (using Jenkins API internally) into your Jenkins instance.

Global Tool Configuration

You can use the jenkins_script resource of the same cookbook to execute any Groovy script. This allows you to configure your Jenkins instance. You now just have to figure out exactly, what the code is to, e.g., select the previously defined credentials. But the code looks similarly to the example given in the cookbook's README.

StephenKing
  • 36,187
  • 11
  • 83
  • 112