mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-01-20 05:19:40 +02:00
Enable configuration of npm registry for mtaBuild
This commit is contained in:
parent
e20eb3c320
commit
79b55cc064
@ -210,6 +210,14 @@ public class MtaBuildTest extends BasePiperTest {
|
||||
assert shellRule.shell.find(){ c -> c.contains('cp settings.xml $M2_HOME/conf/settings.xml')}
|
||||
}
|
||||
|
||||
@Test
|
||||
void canConfigureNpmRegistry() {
|
||||
|
||||
stepRule.step.mtaBuild(script: nullScript, defaultNpmRegistry: 'myNpmRegistry.com')
|
||||
|
||||
assert shellRule.shell.find(){ c -> c.contains('npm config set registry myNpmRegistry.com')}
|
||||
}
|
||||
|
||||
@Test
|
||||
void canConfigureMavenGlobalSettingsFromRemoteSource() {
|
||||
|
||||
|
@ -35,7 +35,9 @@ import static com.sap.piper.Utils.downloadSettingsFromUrl
|
||||
]
|
||||
@Field Set PARAMETER_KEYS = STEP_CONFIG_KEYS.plus([
|
||||
/** @see dockerExecute */
|
||||
'dockerOptions'
|
||||
'dockerOptions',
|
||||
/** Url to the npm registry that should be used for installing npm dependencies.*/
|
||||
'defaultNpmRegistry'
|
||||
])
|
||||
|
||||
/**
|
||||
@ -81,6 +83,11 @@ void call(Map parameters = [:]) {
|
||||
sh "cp ${globalSettingsFile} \$M2_HOME/conf/settings.xml"
|
||||
}
|
||||
|
||||
String defaultNpmRegistry = configuration.defaultNpmRegistry?.trim()
|
||||
if (defaultNpmRegistry) {
|
||||
sh "npm config set registry $defaultNpmRegistry"
|
||||
}
|
||||
|
||||
def mtaYamlName = "mta.yaml"
|
||||
def applicationName = configuration.applicationName
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user