fix: generate npm auth via PowerShell to bypass Jenkins Groovy sandbox
这个提交包含在:
父节点
4b1a85f04f
当前提交
e9b3a39ae0
9
Jenkinsfile
vendored
9
Jenkinsfile
vendored
@ -67,11 +67,10 @@ pipeline {
|
||||
stage('Publish to Nexus') {
|
||||
steps {
|
||||
withCredentials([usernamePassword(credentialsId: 'NEXUS_CREDS', passwordVariable: 'NPM_PASS', usernameVariable: 'NPM_USER')]) {
|
||||
script {
|
||||
def auth = (NPM_USER + ':' + NPM_PASS).bytes.encodeBase64().toString()
|
||||
writeFile file: '.npmrc', text: "//nexus.xuqinmin.com/repository/npm-hosted/:_auth=${auth}\n"
|
||||
bat "npm publish --registry %NEXUS_REGISTRY%"
|
||||
}
|
||||
bat """
|
||||
powershell -NonInteractive -Command "Set-Content .npmrc ('//nexus.xuqinmin.com/repository/npm-hosted/:_auth=' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(\$env:NPM_USER + ':' + \$env:NPM_PASS)))"
|
||||
npm publish --registry %NEXUS_REGISTRY%
|
||||
"""
|
||||
}
|
||||
}
|
||||
post {
|
||||
|
||||
正在加载...
在新工单中引用
屏蔽一个用户