-
Notifications
You must be signed in to change notification settings - Fork 6
/
deploy.ps1
45 lines (37 loc) · 1.1 KB
/
deploy.ps1
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
Param (
$configurationName,
$variables = @{},
$artifacts = @{},
$projectName,
$projectVersion
)
$scriptsPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
# configure deployment
. (Join-Path $scriptsPath "configure.ps1") $configurationName
# perform deployment
$environment = $variables.Environment
if($environment)
{
Write-Host "Deploying to environment: $environment"
# does specified environment exist?
Get-Environment -Name $environment | Out-Null
# deploy AppRolla application
New-Deployment $projectName $projectVersion -To $environment
}
# perform Azure deployment
$azureEnvironment = $variables.AzureEnvironment
if($azureEnvironment)
{
Write-Host "Deploying to Azure CS environment: $azureEnvironment"
# does specified environment exist?
Get-Environment -Name $azureEnvironment | Out-Null
# deploy first Azure application to the selected environment
foreach($app in Get-Application)
{
if($app.Type -eq "Azure")
{
New-Deployment $app.Name $projectVersion -To $azureEnvironment
break
}
}
}