« Azure pipeline » : différence entre les versions
De Banane Atomic
Aller à la navigationAller à la recherche
(→Links) |
|||
Ligne 32 : | Ligne 32 : | ||
= [https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch Release variables] = | = [https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch Release variables] = | ||
* [https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml Predefined variables] | * [https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml Predefined variables] | ||
= YAML = | |||
<kode lang='yaml'> | |||
stages: | |||
- stage: CI | |||
displayName: CI stage | |||
# remove implicite depency on the previous stage, the stages will run in parallel | |||
dependsOn: [] | |||
jobs: | |||
- job: ci_job_1 | |||
variables: | |||
MyVar: 'CI' | |||
steps: | |||
- bash: echo "We are on CI" | |||
- task: PowerShell@2 | |||
displayName: 'PowerShell Script' | |||
inputs: | |||
targetType: filePath | |||
filePath: './$(System.DefaultWorkingDirectory)/Folder/Script.ps1' | |||
arguments: '-Arg1 "$(MyVar)"' | |||
# disable the task | |||
enabled: false | |||
- stage: DEMO | |||
displayName: DEMO stage | |||
dependsOn: [] | |||
jobs: | |||
# use deployment instead of job, with environment and strategy to use the approval mechanism | |||
- deployment: copy_prod_to_demo | |||
environment: DEMO | |||
variables: | |||
MyVar: 'DEMO' | |||
strategy: | |||
runOnce: | |||
deploy: | |||
steps: | |||
- bash: echo "We are on DEMO" | |||
- task: PowerShell@2 | |||
displayName: 'PowerShell Script' | |||
inputs: | |||
targetType: filePath | |||
filePath: './$(System.DefaultWorkingDirectory)/Folder/Script.ps1' | |||
arguments: '-Arg1 "$(MyVar)"' | |||
enabled: false | |||
</kode> |
Version du 26 juin 2020 à 16:12
Links
Steps of a release
- Build the software with a pipeline
- validate product quality (unit tests, SonarCloud)
- Deploy the software
- validate runtime stability (compare telemetry with previous version)
- Release the feature
- validate feature usage
Definitions
Term | Definition |
---|---|
Release pipeline definition | steps to execute to get the artefacts, install and validate the software. template to run a release. |
Release agent | the one who execute the tasks defined in the release pipeline definition. it is the same agent as the one used for the build. |
Artifact | item from a git repository or a build pipeline |
Stages | steps to deploy and validate a software |
Tasks | subparts of a stage |
Job | can execute a set of tasks. a job runs on a agent or can be manually ran. |
Release variables
YAML
stages: - stage: CI displayName: CI stage # remove implicite depency on the previous stage, the stages will run in parallel dependsOn: [] jobs: - job: ci_job_1 variables: MyVar: 'CI' steps: - bash: echo "We are on CI" - task: PowerShell@2 displayName: 'PowerShell Script' inputs: targetType: filePath filePath: './$(System.DefaultWorkingDirectory)/Folder/Script.ps1' arguments: '-Arg1 "$(MyVar)"' # disable the task enabled: false - stage: DEMO displayName: DEMO stage dependsOn: [] jobs: # use deployment instead of job, with environment and strategy to use the approval mechanism - deployment: copy_prod_to_demo environment: DEMO variables: MyVar: 'DEMO' strategy: runOnce: deploy: steps: - bash: echo "We are on DEMO" - task: PowerShell@2 displayName: 'PowerShell Script' inputs: targetType: filePath filePath: './$(System.DefaultWorkingDirectory)/Folder/Script.ps1' arguments: '-Arg1 "$(MyVar)"' enabled: false |