-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathStart-Local.ps1
35 lines (28 loc) · 963 Bytes
/
Start-Local.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
<#
.SYNOPSIS
This script builds and start local environment with docker.
.DESCRIPTION
This script requires docker. This script also overrides .env-file
.PARAMETER SettinsFile
Settings file that contains environment settings. Defaults to 'developer-settings.json'
#>
param(
[Parameter()][string]$SettingsFile = 'developer-settings.json'
)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest
Write-Host "Reading settings from file $SettingsFile"
$settingsJson = Get-Content -Raw -Path $SettingsFile | ConvertFrom-Json
@"
# Dont change manually. This is generated by Start-Local.ps1
GITHUBTOKEN=$($settingsJson.GitHubToken)
GITHUBORGANIZATION=$($settingsJson.GitHubOrganization)
"@ | Out-File -FilePath '.env' -Encoding 'utf8'
docker-compose build
if ($LASTEXITCODE) {
throw "Build failed with exit code $LASTEXITCODE"
}
docker-compose up
if ($LASTEXITCODE) {
throw "Build failed with exit code $LASTEXITCODE"
}