2020年12月8日 | Leave a comment 问题 解决: 实现 mvn test -> mvn package > docker build > kubectl apply pool: name: javaagent demands: maven timeoutInMinutes: 5 steps: - task: Maven@3 displayName: '单元测试' inputs: mavenPomFile: 'src/common-auth-provider/pom.xml' goals: test - task: Maven@3 displayName: '打包JAR' inputs: mavenPomFile: 'src/common-auth-provider/pom.xml' options: '-DskipTests=true' publishJUnitResults: false - task: Docker@2 displayName: buildAndPush inputs: containerRegistry: docker2 repository: 'common-auth-provider' Dockerfile: 'src/common-auth-provider/devops/Dockerfile' buildContext: 'src/common-auth-provider/target/' - task: KubernetesManifest@0 displayName: deploy inputs: kubernetesServiceConnection: 10.0.4.56 namespace: default manifests: 'src/common-auth-provider/devops/k8s.yaml' containers: 'nexus:8082/common-auth-provider:$(Build.BuildId)' imagePullSecrets: 'telsafe-nexus' rolloutStatusTimeout: 120 12345678910111213141516171819202122232425262728293031323334353637 pool: name: javaagent demands: maven timeoutInMinutes: 5 steps:- task: Maven@3 displayName: '单元测试' inputs: mavenPomFile: 'src/common-auth-provider/pom.xml' goals: test - task: Maven@3 displayName: '打包JAR' inputs: mavenPomFile: 'src/common-auth-provider/pom.xml' options: '-DskipTests=true' publishJUnitResults: false - task: Docker@2 displayName: buildAndPush inputs: containerRegistry: docker2 repository: 'common-auth-provider' Dockerfile: 'src/common-auth-provider/devops/Dockerfile' buildContext: 'src/common-auth-provider/target/' - task: KubernetesManifest@0 displayName: deploy inputs: kubernetesServiceConnection: 10.0.4.56 namespace: default manifests: 'src/common-auth-provider/devops/k8s.yaml' containers: 'nexus:8082/common-auth-provider:$(Build.BuildId)' imagePullSecrets: 'telsafe-nexus' rolloutStatusTimeout: 120 参考: https://docs.microsoft.com/zh-cn/azure/devops/pipelines/?view=azure-devops