-
Notifications
You must be signed in to change notification settings - Fork 26
/
azure-pipelines.yml
59 lines (51 loc) · 2.28 KB
/
azure-pipelines.yml
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
name: 0.0.$(Build.BuildId)
# Linux based agent; all except the first step will also work on Windows
queue:
name: Hosted Ubuntu 1604
# The scheduled trigger will be set in the Azure DevOps portal
trigger: none
steps:
# Set the number of the build
- task: PowerShell@2
displayName: Update Build Number
inputs:
targetType: 'inline'
script: '$id = "$(Build.BuildId)"; $date = Get-Date -Format "yyyy.MMdd"; Write-Host "##vso[build.updatebuildnumber]$date.$id"'
# Install AzCopy v10
- task: Bash@3
displayName: "Install AzCopy v10"
inputs:
targetType: 'inline'
script: 'wget https://azcopyvnext.azureedge.net/release20190301/azcopy_linux_amd64_10.0.8.tar.gz && tar xvzf ./azcopy_linux_amd64_10.0.8.tar.gz && rm ./azcopy_linux_amd64_10.0.8.tar.gz && cp ./azcopy_linux_amd64_10.0.8/azcopy ./ && rm -rf ./azcopy_linux_amd64_10.0.8 && ./azcopy --version'
# Install the Az PowerShell modules our script will need
- task: PowerShell@2
displayName: Install PowerShell Modules (Az.Accounts, Az.KeyVault, Az.Resources, Posh-ACME)
inputs:
targetType: 'inline'
script: 'Install-Module Az.Accounts, Az.KeyVault, Az.Resources, Posh-ACME -Force'
errorActionPreference: 'stop'
failOnStderr: true
pwsh: true
# Order or renew a certificate via ACME
- task: AzurePowerShell@4
displayName: Order or Renew Certificate
inputs:
azureSubscription: 'ACME Certificate Automation'
scriptType: 'FilePath'
scriptPath: 'New-AcmeCertificate.ps1 '
scriptArguments: '-AcmeDirectory "$(AcmeDirectory)" -AcmeContact "$(AcmeContact)" -CertificateNames "$(CertificateNames)" -StorageContainerSASToken "$(StorageContainerSASToken)"'
errorActionPreference: 'stop'
failOnStandardError: true
azurePowerShellVersion: 'LatestVersion'
# Import the certificate into Azure Key Vault
- task: AzurePowerShell@4
displayName: Import Certificate into Key Vault
inputs:
azureSubscription: 'ACME Certificate Automation'
scriptType: 'FilePath'
scriptPath: 'Import-AcmeCertificateToKeyVault.ps1 '
scriptArguments: '-CertificateNames "$(CertificateNames)" -KeyVaultResourceId "$(KeyVaultResourceId)"'
errorActionPreference: 'stop'
failOnStandardError: true
azurePowerShellVersion: 'LatestVersion'
condition: "and(succeeded(), ne(variables['KeyVaultResourceId'], ''))"