Class RegistryHelper
java.lang.Object
jenkins.plugins.nodejs.configfiles.RegistryHelper
Helper to fill properly credentials in the the user configuration file.
- Since:
- 1.0
- Author:
- Nikolas Falco
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncalculatePrefix
(String registryURL) fillRegistry
(String npmrcContent, Map<String, com.cloudbees.plugins.credentials.common.StandardCredentials> registry2Credentials) Fill the npmpc user config with the given registries.fillRegistry
(String npmrcContent, Map<String, com.cloudbees.plugins.credentials.common.StandardCredentials> registry2Credentials, boolean npm9Format) Fill the npmpc user config with the given registries.resolveCredentials
(Run<?, ?> build) Resolves all registry credentials and returns a map paring registry URL to credential.secretsForMasking
(Run<?, ?> build)
-
Constructor Details
-
RegistryHelper
-
-
Method Details
-
resolveCredentials
public Map<String,com.cloudbees.plugins.credentials.common.StandardCredentials> resolveCredentials(Run<?, ?> build) Resolves all registry credentials and returns a map paring registry URL to credential.- Parameters:
build
- a build being run- Returns:
- map of registry URL - credential
-
fillRegistry
public String fillRegistry(String npmrcContent, Map<String, com.cloudbees.plugins.credentials.common.StandardCredentials> registry2Credentials) Fill the npmpc user config with the given registries.- Parameters:
npmrcContent
- .npmrc user configregistry2Credentials
- the credentials to be inserted into the user config (key: registry URL, value: Jenkins credentials)- Returns:
- the updated version of the
npmrcContent
with the registry credentials added
-
fillRegistry
public String fillRegistry(String npmrcContent, Map<String, com.cloudbees.plugins.credentials.common.StandardCredentials> registry2Credentials, boolean npm9Format) Fill the npmpc user config with the given registries.- Parameters:
npmrcContent
- .npmrc user configregistry2Credentials
- the credentials to be inserted into the user config (key: registry URL, value: Jenkins credentials)npm9Format
- use npm version 9 format- Returns:
- the updated version of the
npmrcContent
with the registry credentials added
-
calculatePrefix
-
compose
-
secretsForMasking
-