Pipelines/Local-DevEnv.ps1
Param( [Parameter(Mandatory=$false)] [string] $version = "local", [Parameter(Mandatory=$true)] [string] $settingsFile, [Parameter(Mandatory=$true)] [string] $licenseFile, [string] $newContainerName = "", [string] $login = "admin", [string] $password = "123qweasD" ) $ciFolder = (Get-Item (Join-Path $PSScriptRoot "..")).FullName $baseFolder = (Get-Item (Join-Path $ciFolder "..")).FullName . (Join-Path $PSScriptRoot "Read-Settings.ps1") -environment 'Local' -version $version -settingsFile $settingsFile . (Join-Path $PSScriptRoot "Install-BcContainerHelper.ps1") -bcContainerHelperVersion $bcContainerHelperVersion -genericImageName $genericImageName if ($newContainerName -ne "") { $containerName = $newContainerName } $securePassword = ConvertTo-SecureString -String $password -AsPlainText -Force $credential = New-Object pscredential $login, $securePassword $artifact = $artifact.replace('{INSIDERSASTOKEN}',$insiderSasToken) if ($artifact -like "https://*") { $artifactUrl = $artifact } else { $segments = "$artifact/////".Split('/') $storageAccount = $segments[0]; $type = $segments[1]; if ($type -eq "") { $type = 'Sandbox' } $version = $segments[2] $country = $segments[3]; if ($country -eq "") { $country = "w1" } $select = $segments[4]; if ($select -eq "") { $select = "latest" } $sasToken = $segments[5] Write-Host "Determining artifacts to use" $minsto = $storageAccount $minsel = $select $mintok = $sasToken $artifactUrl = Get-BCArtifactUrl -storageAccount $minsto -type $type -version $version -country $country -select $minsel -sasToken $mintok | Select-Object -First 1 if (!($artifactUrl)) { throw "Unable to locate artifacts" } } Write-Host -ForegroundColor Yellow @' ====================================== PARAMETERS ========================================= '@ Write-Host -NoNewLine -ForegroundColor Yellow "Container name: "; Write-Host $containerName Write-Host -NoNewLine -ForegroundColor Yellow "Instance name: "; Write-Host "BC" Write-Host -NoNewLine -ForegroundColor Yellow "BC Login: "; Write-Host $login Write-Host -NoNewLine -ForegroundColor Yellow "BC Password: "; Write-Host $password Write-Host -NoNewLine -ForegroundColor Yellow "BC Authentication: "; Write-Host "UserPassword" Write-Host -NoNewLine -ForegroundColor Yellow "BC Artifact URL: "; Write-Host $artifactUrl Write-Host -NoNewLine -ForegroundColor Yellow "License File: "; Write-Host $licenseFile if ($restoreDbFromBackupUrl -ne "") { Write-Host -NoNewLine -ForegroundColor Yellow "Database backup: "; Write-Host $restoreDbFromBackupUrl } Write-Host -ForegroundColor Yellow @' =========================================================================================== '@ New-BcContainer ` -accept_eula ` -containerName $containerName ` -credential $credential ` -auth 'UserPassword' ` -artifactUrl $artifactUrl ` -bakFile $restoreDbFromBackupUrl ` -licenseFile $licenseFile ` -isolation 'process' ` -memoryLimit 8G ` -updateHosts ` -dns '8.8.8.8' |