问题
解决:
实现 mvn test -> mvn package > docker build > kubectl apply
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
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