forked from ministero-salute/it-dgc-verificaC19-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release-pipeline.yaml
118 lines (108 loc) · 6.61 KB
/
release-pipeline.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: release-dgca-verifier-app-android
trigger: none
# resources: # types: pipelines | builds | repositories | containers | packages
# pipelines:
# - pipeline: it-dgc-verificaC19-android # identifier for the resource used in pipeline resource variables
# source: ministero-salute.it-dgc-verificaC19-android # name of the pipeline that produces an artifact
# # version: string # the pipeline run number to pick the artifact, defaults to latest pipeline successful across all stages; Used only for manual or scheduled triggers
# # branch: string # branch to pick the artifact, optional; defaults to all branches; Used only for manual or scheduled triggers
# # tags: [ string ] # list of tags required on the pipeline to pickup default artifacts, optional; Used only for manual or scheduled triggers
# # trigger: # triggers are not enabled by default unless you add trigger section to the resource
# # branches: # branch conditions to filter the events, optional; Defaults to all branches.
# # include: [ string ] # branches to consider the trigger events, optional; Defaults to all branches.
# # exclude: [ string ] # branches to discard the trigger events, optional; Defaults to none.
# # tags: [ string ] # list of tags to evaluate for trigger event, optional
# # stages: [ string ] # list of stages to evaluate for trigger event, optional
pool:
vmImage: 'ubuntu-latest'
variables:
publishToAppCenter: $[eq(variables['Build.SourceBranch'], 'refs/heads/develop')]
publishToStore: $[contains(variables['Build.SourceBranch'], 'refs/heads/releases')]
stages:
- stage: AppCenterRelease
jobs:
- deployment: AppCenterRelease # name of the deployment job, A-Z, a-z, 0-9, and underscore. The word "deploy" is a keyword and is unsupported as the deployment name.
displayName: Release to AppCenter # friendly name to display in the UI
# pool: # see pool schema
# name: string # Use only global level variables for defining a pool name. Stage/job level variables are not supported to define pool name.
# demands: string | [ string ]
workspace:
clean: all # what to clean up before the job runs
# dependsOn: string
# condition: string
# continueOnError: boolean # 'true' if future jobs should run even if this job fails; defaults to 'false'
# container: containerReference # container to run this job inside
# services: { string: string | container } # container resources to run as a service container
# timeoutInMinutes: nonEmptyString # how long to run the job before automatically cancelling
# cancelTimeoutInMinutes: nonEmptyString # how much time to give 'run always even if cancelled tasks' before killing them
# variables: # several syntaxes, see specific section
environment: AppCenter # target environment name and optionally a resource name to record the deployment history; format: <environment-name>.<resource-name>
strategy:
runOnce: #rolling, canary are the other strategies that are supported
preDeploy:
steps:
- task: Bash@3
displayName: check pipeline variable value
inputs:
targetType: 'inline'
script: |
echo 'Check pipeline var'
echo 'publishToAppCenter: $(publishToAppCenter)'
echo 'publishToStore $(publishToStore)'
failOnStderr: true
deploy:
steps:
- script: |
ls -l
cd $(PIPELINE.WORKSPACE)/it-dgc-verificaC19-android
ls -l
cd apk
ls -l
- task: AppCenterDistribute@3
inputs:
serverEndpoint: 'DGC-App'
appSlug: 'sogei/it-dgc-verificaC19-android'
appFile: '$(Pipeline.Workspace)/it-dgc-verificaC19-android/apk/app-release-unsigned.apk'
symbolsOption: 'Android'
releaseNotesOption: 'file'
releaseNotesFile: '$(PIPELINE.WORKSPACE)/it-dgc-verificaC19-android/release-notes/release-notes.xml'
destinationType: 'groups'
isSilent: true
#condition: eq(variables.publishToAppCenter, true)
- stage: GooglePlayTestRelease
condition: eq(variables.publishToStore, true)
jobs:
- deployment: GooglePlayRelease # name of the deployment job, A-Z, a-z, 0-9, and underscore. The word "deploy" is a keyword and is unsupported as the deployment name.
displayName: Release to Google Play # friendly name to display in the UI
# pool: # see pool schema
# name: string # Use only global level variables for defining a pool name. Stage/job level variables are not supported to define pool name.
# demands: string | [ string ]
workspace:
clean: all # what to clean up before the job runs
# dependsOn: string
# condition: string
# continueOnError: boolean # 'true' if future jobs should run even if this job fails; defaults to 'false'
# container: containerReference # container to run this job inside
# services: { string: string | container } # container resources to run as a service container
# timeoutInMinutes: nonEmptyString # how long to run the job before automatically cancelling
# cancelTimeoutInMinutes: nonEmptyString # how much time to give 'run always even if cancelled tasks' before killing them
# variables: # several syntaxes, see specific section
environment: AndroidStoreTest # target environment name and optionally a resource name to record the deployment history; format: <environment-name>.<resource-name>
strategy:
runOnce: #rolling, canary are the other strategies that are supported
deploy:
steps:
- script: |
ls -l
cd $(PIPELINE.WORKSPACE)/it-dgc-verificaC19-android
ls -l
cd bundle
ls -l
# - task: GooglePlayReleaseBundle@3
# inputs:
# serviceConnection: 'verificac19-google-play'
# applicationId: 'it.ministerodellasalute.verificaC19'
# bundleFile: '$(Pipeline.Workspace)/it-dgc-verificaC19-android/bundle/app-release.aab'
# track: 'internal'
# changeLogFile: '$(Pipeline.Workspace)/it-dgc-verificaC19-android/release-notes/release-notes.xml'
# languageCode: 'en-GB'