|
1 | 1 | trigger: |
2 | | - - main |
| 2 | +- main |
3 | 3 |
|
4 | 4 | variables: |
5 | | - - name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE |
6 | | - value: true |
7 | | - - name: DOTNET_CLI_TELEMETRY_OPTOUT |
8 | | - value: 1 |
| 5 | +- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE |
| 6 | + value: true |
| 7 | +- name: DOTNET_CLI_TELEMETRY_OPTOUT |
| 8 | + value: 1 |
9 | 9 |
|
10 | 10 | stages: |
11 | | - - stage: assemble |
12 | | - displayName: Assemble |
13 | | - jobs: |
14 | | - - job: build |
15 | | - displayName: Build |
16 | | - pool: |
17 | | - vmImage: ubuntu-latest |
18 | | - steps: |
19 | | - - task: UseDotNet@2 |
20 | | - displayName: 'Use .NET Core SDK 6.0' |
21 | | - inputs: |
22 | | - packageType: sdk |
23 | | - version: 6.0.x |
24 | | - - task: DotNetCoreCLI@2 |
25 | | - displayName: dotnet restore |
26 | | - inputs: |
27 | | - command: restore |
28 | | - - task: DotNetCoreCLI@2 |
29 | | - displayName: dotnet build |
30 | | - inputs: |
31 | | - command: build |
32 | | - arguments: --no-restore /p:TreatWarningsAsErrors=True |
33 | | - - task: DotNetCoreCLI@2 |
34 | | - displayName: dotnet test |
35 | | - inputs: |
36 | | - command: test |
37 | | - arguments: --no-build |
38 | | - - job: kubernetes |
39 | | - displayName: Kubernetes |
40 | | - pool: |
41 | | - vmImage: ubuntu-latest |
42 | | - steps: |
43 | | - - task: ShellScript@2 |
44 | | - displayName: Generate Staging Manifest |
45 | | - inputs: |
46 | | - scriptPath: ./yttw.sh |
47 | | - args: > |
48 | | - -f kubernetes |
49 | | - -v image_tag=$(Build.BuildId) |
50 | | - -v dotnet_environment=Staging |
51 | | - --output-files manifests/staging |
52 | | - - task: ShellScript@2 |
53 | | - displayName: Generate Production Manifest |
54 | | - inputs: |
55 | | - scriptPath: ./yttw.sh |
56 | | - args: > |
57 | | - -f kubernetes |
58 | | - -v image_tag=$(Build.BuildId) |
59 | | - -v replica_count=2 |
60 | | - -v dotnet_environment=Production |
61 | | - --output-files manifests/production |
62 | | - - task: PublishPipelineArtifact@1 |
63 | | - displayName: Publish Manifests |
64 | | - inputs: |
65 | | - targetPath: manifests |
66 | | - artifactName: manifests |
67 | | - - stage: Deploy |
68 | | - displayName: Deploy |
69 | | - dependsOn: assemble |
70 | | - condition: |
71 | | - not(eq(variables['build.reason'], 'PullRequest')) |
72 | | - jobs: |
73 | | - - job: push |
74 | | - displayName: Push |
75 | | - pool: |
76 | | - vmImage: ubuntu-latest |
77 | | - steps: |
78 | | - - task: Docker@2 |
79 | | - displayName: Build and Push |
80 | | - inputs: |
81 | | - command: buildAndPush |
82 | | - containerRegistry: SteeltoeContainerRegistry |
83 | | - repository: net-core-tool-service |
84 | | - tags: | |
85 | | - $(Build.BuildId) |
86 | | - latest |
| 11 | +- stage: assemble |
| 12 | + displayName: Assemble |
| 13 | + jobs: |
| 14 | + - job: build |
| 15 | + displayName: Build |
| 16 | + pool: |
| 17 | + vmImage: ubuntu-latest |
| 18 | + steps: |
| 19 | + - task: UseDotNet@2 |
| 20 | + displayName: 'Use .NET Core SDK 6.0' |
| 21 | + inputs: |
| 22 | + packageType: sdk |
| 23 | + version: 6.0.x |
| 24 | + - task: DotNetCoreCLI@2 |
| 25 | + displayName: dotnet restore |
| 26 | + inputs: |
| 27 | + command: restore |
| 28 | + - task: DotNetCoreCLI@2 |
| 29 | + displayName: dotnet build |
| 30 | + inputs: |
| 31 | + command: build |
| 32 | + arguments: --no-restore /p:TreatWarningsAsErrors=True |
| 33 | + - task: DotNetCoreCLI@2 |
| 34 | + displayName: dotnet test |
| 35 | + inputs: |
| 36 | + command: test |
| 37 | + arguments: --no-build |
| 38 | + - job: kubernetes |
| 39 | + displayName: Kubernetes |
| 40 | + pool: |
| 41 | + vmImage: ubuntu-latest |
| 42 | + steps: |
| 43 | + - task: ShellScript@2 |
| 44 | + displayName: Generate Staging Manifest |
| 45 | + inputs: |
| 46 | + scriptPath: ./yttw.sh |
| 47 | + args: > |
| 48 | + -f kubernetes |
| 49 | + -v image_tag=$(Build.BuildId) |
| 50 | + -v dotnet_environment=Staging |
| 51 | + --output-files manifests/staging |
| 52 | + - task: ShellScript@2 |
| 53 | + displayName: Generate Production Manifest |
| 54 | + inputs: |
| 55 | + scriptPath: ./yttw.sh |
| 56 | + args: > |
| 57 | + -f kubernetes |
| 58 | + -v image_tag=$(Build.BuildId) |
| 59 | + -v replica_count=2 |
| 60 | + -v dotnet_environment=Production |
| 61 | + --output-files manifests/production |
| 62 | + - task: PublishPipelineArtifact@1 |
| 63 | + displayName: Publish Manifests |
| 64 | + inputs: |
| 65 | + targetPath: manifests |
| 66 | + artifactName: manifests |
| 67 | +- stage: Deploy |
| 68 | + displayName: Deploy |
| 69 | + dependsOn: assemble |
| 70 | + condition: |
| 71 | + not(eq(variables['build.reason'], 'PullRequest')) |
| 72 | + jobs: |
| 73 | + - job: push |
| 74 | + displayName: Push |
| 75 | + pool: |
| 76 | + vmImage: ubuntu-latest |
| 77 | + steps: |
| 78 | + - task: Docker@2 |
| 79 | + displayName: Build and Push |
| 80 | + inputs: |
| 81 | + command: buildAndPush |
| 82 | + containerRegistry: SteeltoeContainerRegistry |
| 83 | + repository: net-core-tool-service |
| 84 | + tags: | |
| 85 | + $(Build.BuildId) |
| 86 | + latest |
0 commit comments