-
Notifications
You must be signed in to change notification settings - Fork 2
/
azure-pipelines.yaml
73 lines (70 loc) · 1.67 KB
/
azure-pipelines.yaml
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
trigger:
- main
variables:
- name: major
value: 0
- name: minor
value: 2
- name: patch
value: 0
name: $(major).$(minor).$(patch)-$(Rev:r)
stages:
- stage: assemble
displayName: Assemble
jobs:
- job: build
displayName: Build
pool:
vmImage: ubuntu-latest
steps:
- task: Gradle@1
displayName: Gradle Build
inputs:
jdkVersionOption: 1.11
- stage: Deploy
displayName: Deploy
dependsOn: assemble
condition:
not(eq(variables['build.reason'], 'PullRequest'))
jobs:
- job: deploy
displayName: Deploy Docker Image
pool:
vmImage: ubuntu-latest
steps:
- task: CmdLine@2
displayName: 'Set Version'
inputs:
script: ./setversion.sh $(Build.BuildNumber)
- task: Docker@2
displayName: Build and Push Docker Image
inputs:
command: buildAndPush
containerRegistry: SteeltoeContainerRegistry
repository: initializr-config-server
tags: |
$(Build.BuildId)
latest
- task: ShellScript@2
displayName: Generate Staging Manifest
inputs:
scriptPath: ./yttw.sh
args: >
-f kubernetes
-v image_tag=$(Build.BuildId)
-v args=--debug
--output-files manifests/staging
- task: ShellScript@2
displayName: Generate Production Manifest
inputs:
scriptPath: ./yttw.sh
args: >
-f kubernetes
-v image_tag=$(Build.BuildId)
-v replica_count=2
--output-files manifests/production
- task: PublishPipelineArtifact@1
displayName: Publish Manifests
inputs:
targetPath: manifests
artifactName: manifests