用户名中有错字。将Jenkins凭据作为环境变量传递可以按预期方式工作。这是我的代码: build.gradle(臂架配置):
jib { to { image = "myacr.azurecr.io/" + project.name tags = ["latest"] auth { // retrieve from Jenkins username "${System.env.ACR_CREDENTIALS_USR}" password "${System.env.ACR_CREDENTIALS_PSW}" } } container { jvmFlags = ["-Xms512M", "-Xmx1G"] ports = ["5000/tcp", "8080/tcp"] } }
Jenkinsfile:
pipeline {... environment { ACR_CREDENTIALS = credentials('myproject-acr') } stages { ... stage('Push Docker Image to Registry') { steps { sh "./gradlew jib" } }...
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)