hoylemd
hoylemd

Reputation: 456

Does Jenkins have a feature like credentials for non-secrets?

real simple question today.

Does Jenkins have a feature like credentials that is for non-secret information?

My use case is that I want to specify some values in jenkins to make them easily available to all of my pipelines. (e.g. an Azure subscription id) I tried to just use 'secret text' type credentials, but the magic that jenkins does to protect those credentials make it difficult to work with them.

I imagine it would be called something like global environment variables, or named values, but I haven't been able to find anything with my googling.

Thanks!

Upvotes: 3

Views: 770

Answers (1)

Kailash
Kailash

Reputation: 550

The following steps will help you setup global environment variables which can be used within various builds and pipelines. The steps may be slightly different based on the version of Jenkins installed. The steps noted below are based on version 2.7.4:

  • Navigate to Manage Jenkins on the left side menu
  • Click "Configure System"
  • Scroll down to find "Global properties"
  • Check "Environment variables"
  • Click "Add"
  • Add the name and value in correct input area (Example: arg_name & arg_value)
  • Click "Save" at the bottom of the page

To use this global environment variable, navigate to an input area within a build definition and use: ${arg_name}

Upvotes: 4

Related Questions