| thanks Andrew Bayer! I now tried the following: node{ withEnv(['dbName = "test-$\{env.BUILD_NUMBER}"', 'X_SITENAME = "HELLO"', 'X_DB_USER = "mp"', 'DOMAIN_NAME = "https://www.example.com"']) { configFileProvider([configFile(fileId: 'settings_php', replaceTokens: true, targetLocation: "$\{dbName}/www/local.settings.php")]) { sh "cat ${env.dbName}/www/local.settings.php" } } } node{ withEnv(['dbName = "test-$\{env.BUILD_NUMBER}"', 'X_SITENAME = "HELLO"', 'X_DB_USER = "mp"', 'DOMAIN_NAME = "https://www.example.com"']) { configFileProvider([configFile(fileId: 'settings_php', replaceTokens: true, targetLocation: "$\{dbName}/www/local.settings.php")]) { sh "cat ${dbName}/www/local.settings.php" } } } ...unfortunate it did not work - it already fails at this: sh "cat ${env.dbName}/www/local.settings.php" because it can't find "dbName" tested on:
- jenkins 2.73.4.1 (DEV@cloud)
- pipeline 2.4
|