/
tests.ps1
35 lines (29 loc) · 1.04 KB
/
tests.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
Param($sistema = $(throw "Parâmetro $($sistema) deve ser informado"),
$From,
$To
)
If (-not ($From -eq $null) -and ("DEPLOY","HML","DSV" -NotContains $From))
{
Throw "`$From is not a valid param! Please use DEPLOY, HML, DSV"
}
If (-not ($To -eq $null) -and ("DEPLOY","HML","DSV" -NotContains $To))
{
Throw "`$To is not a valid param! Please use DEPLOY, HML, DSV"
}
If (-not ($To -eq $null) -and (-not ($From -eq $null)) -and $From -eq $To )
{
Throw "Parametros `$From e `$To não pode ser iguais"
}
./LoadConfig app.config
$appServiceKeyFrom = "";
$appServiceKeyTo = "";
if($From -eq $null -or $To -eq $null)
{
$appServiceKeyFrom = $sistema + "-SERVICE-DEPLOY";
$appServiceKeyTo = $sistema + "-SERVICE-HML";
}
if($appSettings[$appServiceKeyTO] -eq $null -or $appSettings[$appServiceKeyFrom] -eq $null)
{
Write-Output "Configuração $appServiceKeyTo $appServiceKeyFrom não encontrada ";
}
# ./executeDeployInterno $appServiceKeyFrom $appServiceKeyTo