@@ -4,38 +4,23 @@ New-Item .\package -type directory -f
4
4
New-Item .\package\temp - type directory -f
5
5
Copy-Item .\backup.js .\package\temp\
6
6
Copy-Item .\diff.js .\package\temp\
7
- Copy-Item .\index.js .\package\temp\
8
7
Copy-Item .\s3- backfill.js .\package\temp\
9
8
Copy-Item .\s3- snapshot.js .\package\temp\
10
9
Copy-Item .\node_modules\ .\package\temp\ - recurse
11
10
12
- $dc2 = New-Object System.Management.Automation.Host.ChoiceDescription " &2" , " Deploys to dc2"
13
- $dc3 = New-Object System.Management.Automation.Host.ChoiceDescription " &3" , " Deploys to dc3"
14
- $dc4 = New-Object System.Management.Automation.Host.ChoiceDescription " &4" , " Deploys to dc4"
15
- $dc5 = New-Object System.Management.Automation.Host.ChoiceDescription " &5" , " Deploys to dc5"
16
- $dc6 = New-Object System.Management.Automation.Host.ChoiceDescription " &6" , " Deploys to dc6"
17
- $dc7 = New-Object System.Management.Automation.Host.ChoiceDescription " &7" , " Deploys to dc7"
18
- $dc8 = New-Object System.Management.Automation.Host.ChoiceDescription " &8" , " Deploys to dc8"
19
-
20
- Write-Output " Which DC would you like to deploy to?"
21
- $options = [System.Management.Automation.Host.ChoiceDescription []]($dc2 , $dc3 , $dc4 , $dc5 , $dc6 , $dc7 , $dc8 )
22
- $result = $host.ui.PromptForChoice ($title , $message , $options , 0 )
23
- $dcDeploy = 0
24
-
25
- switch ($result )
26
- {
27
- 0 {$dcDeploy = 2 }
28
- 1 {$dcDeploy = 3 }
29
- 2 {$dcDeploy = 4 }
30
- 3 {$dcDeploy = 5 }
31
- 4 {$dcDeploy = 6 }
32
- 5 {$dcDeploy = 7 }
33
- 6 { $dcDeploy = 8 }
34
- }
35
- Copy-Item .\config\dc$dcDeploy.env .\package\temp\deploy.env
11
+ $environmentFile = Read-Host - Prompt ' Enter the name of the config file you would like to add to your deployment (e.g. dcx.env)'
12
+
13
+ $currentdir = $PSScriptRoot
14
+
15
+ New-Item .\package\temp\index.js - type file -f
16
+
17
+ get-content .\config\$environmentFile , " .\index.js" | set-content " .\package\temp\index.js"
36
18
37
19
$version = Read-Host - Prompt ' What version of the application are you deploying?'
38
20
39
- $currentdir = $PSScriptRoot
21
+ $destination = $currentdir + " \package\" + $version + " .zip"
22
+
40
23
Add-Type - assembly " system.io.compression.filesystem"
41
- [io.compression.zipfile ]::CreateFromDirectory($currentdir + " \package\temp" , $currentdir + " .\package\" + $version + " .zip" )
24
+ [io.compression.zipfile ]::CreateFromDirectory($currentdir + " \package\temp" , $destination )
25
+
26
+ Write-Output " lambda app ready to be uploaded. Located at: " $destination
0 commit comments