我尝试按照文档中的说明通过 jFrog 服务器从 Jenkins 触发 X 射线扫描。
使用的管道代码如下:
node {
stage('XRAY Scan') {
def server = Artifactory.server('jFrogServer')
def buildInfo = Artifactory.newBuildInfo()
buildInfo.env.capture = true
def scanConfig = [
'buildName' : buildInfo.name,
'buildNumber' : buildInfo.number,
'failBuild' : true
]
def scanResult = server.xrayScan(scanConfig)
echo scanResult as String
}
}
执行此管道时,我在控制台中收到以下响应:
Xray scan connection lost: Artifactory response: Forbidden, attempting to reconnect...