Created
January 5, 2022 10:05
-
-
Save dongmai/e641249e19cf9a8f44989a2940ca3424 to your computer and use it in GitHub Desktop.
Copy a jenkins job
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let jenkins = JenkinsService.initJenkinsApi(jenkin) | |
jenkins.copy_job( | |
templateJobName, | |
jobName, | |
(config) => { | |
config = config.replace('<concurrentBuild>false</concurrentBuild>', `<concurrentBuild>false</concurrentBuild>\n<customWorkspace>workspace/${templateJobName}</customWorkspace>`) | |
config = config.replace('{GYM_EXPORT_TEAM_ID}', `${appStoreAccount.teamId}`) | |
config = config.replace('{KEY_ID}', `${appStoreAccount.keyId}`) | |
config = config.replace('{ISSUER_ID}', `${appStoreAccount.issuerId}`) | |
config = config.replace('{KEY_CONTENT_BASE64}', `${Util.base64Text(appStoreAccount.apiKey)}`) | |
config = config.replace('{REMOTE_JOB_ID}', jenkinJob.id) | |
config = config.replace('{KEYCHAIN_PASSWORD}', jenkin.keychainPassword) | |
config = config.replace('{APP_GENERATION_ENDPOINT}', endpointUrl) | |
return config | |
}, | |
{}, | |
(err, data) => { | |
if (err) { | |
reject(err) | |
} else { | |
data.jobName = jobName | |
resolve(data) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment