-
Notifications
You must be signed in to change notification settings - Fork 0
/
EnvironmentDeploy.yaml
48 lines (42 loc) · 1.61 KB
/
EnvironmentDeploy.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
parameters:
- name: environment
type: string
default: ""
jobs:
- deployment: Deploy_${{ parameters.environment }}
workspace:
clean: all
displayName: ${{ parameters.environment }}
environment: ${{ parameters.environment }}
timeoutInMinutes: 360
strategy:
runOnce:
deploy:
steps:
- download: current
artifact: drop
- pwsh: |
$WeekNum = Get-Date -UFormat "%V"
Write-Host "##vso[task.setvariable variable=WeekNum]$WeekNum"
displayName: 'Get WeekNumber for Caching'
- task: Cache@2
inputs:
key: ppdo_v2_$(WeekNum) | $(Agent.OS)
path: $(UserProfile)\Documents\WindowsPowerShell\
cacheHitVar: ToolingCached
displayName: Cache Tooling components
- task: PowerShell@2
displayName: 'Install Microsoft.PowerPlatform.DevOps'
inputs:
targetType: 'inline'
script: |
Install-Module -Name Microsoft.PowerPlatform.DevOps -AllowClobber -Scope CurrentUser -Force
#Install-Module -Name Microsoft.PowerPlatform.DevOps -AllowClobber -AllowPrerelease -Scope CurrentUser -Force
- task: PowerShell@2
displayName: 'Deploy Solution'
inputs:
targetType: 'inline'
script: |
$useSP = Test-IsGuid $(d365username)
Write-Host Use Service Principal - $useSP
Start-DeploySolution -DeployServerUrl $(d365url) -UserName $(d365username) -Password $(d365password) -PipelinePath $(Pipeline.Workspace)/drop -UseClientSecret $useSP