-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy-stack.ps1
18 lines (14 loc) · 915 Bytes
/
deploy-stack.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$projects = @(
"SamShips.Heartbeat",
"SamShips.WebAPI"
)
foreach ($project in $projects) {
Write-Host "Creating package for $project" -ForegroundColor Green -BackgroundColor Black
dotnet lambda package -c Release -f "netcoreapp3.1" --project-location ".\src\Backend\$project" --output-package ".\artifacts\$project.zip"
}
Write-Host "Packages updated, deploying stack..." -ForegroundColor Green -BackgroundColor Black
aws cloudformation package --template-file sam-template.yaml --s3-bucket nino-samships-deployment --output-template-file sam-output-template.yaml
if ( $LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
aws cloudformation validate-template --template-body file://sam-output-template.yaml
if ( $LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
aws cloudformation deploy --template-file sam-output-template.yaml --stack-name samships --capabilities CAPABILITY_IAM --no-fail-on-empty-changeset