-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathbuild-layers.ps1
More file actions
27 lines (23 loc) · 1.35 KB
/
build-layers.ps1
File metadata and controls
27 lines (23 loc) · 1.35 KB
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
$ProgressPreference = 'SilentlyContinue'
$examplesPath = Split-Path -Path $PSScriptRoot -Parent
$gitRoot = Split-Path -Path $examplesPath -Parent
$layersRoot = Join-Path -Path $PSScriptRoot -ChildPath 'layers'
####################
# PwshRuntimeLayer #
####################
$runtimeLayerPath = Join-Path -Path $layersRoot -ChildPath 'runtimeLayer'
$runtimeBuildScript = [System.IO.Path]::Combine($gitRoot, 'powershell-runtime', 'build-PwshRuntimeLayer.ps1')
& $runtimeBuildScript -PwshArchitecture 'x64' -LayerPath $runtimeLayerPath
#################
# AWSToolsLayer #
#################
$awsToolsLayerPath = Join-Path -Path $layersRoot -ChildPath 'modulesLayer'
$awsToolsBuildScript = [System.IO.Path]::Combine($gitRoot, 'powershell-modules', 'AWSToolsforPowerShell', 'Demo-AWS.Tools', 'build-AWSToolsLayer.ps1')
& $awsToolsBuildScript -ModuleList 'AWS.Tools.Common' -LayerPath $awsToolsLayerPath
########################
# SAM Template Updates #
########################
$samTemplatePath = Join-Path -Path $PSScriptRoot -ChildPath 'template.yml'
(Get-Content -Path $samTemplatePath -Raw).replace(
'ContentUri: ../../powershell-runtime/source', 'ContentUri: ./layers/runtimeLayer').replace(
'ContentUri: ../../powershell-modules/AWSToolsforPowerShell/Demo-AWS.Tools/buildlayer', 'ContentUri: ./layers/modulesLayer') | Set-Content -Path $samTemplatePath -Encoding ascii