File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ if ((Get-AWSCredentials ) -eq $null )
2+ {
3+ throw " You must set credentials via Set-AWSCredentials before running this cmdlet."
4+ }
5+ if ((Get-DefaultAWSRegion ) -eq $null )
6+ {
7+ throw " You must set a region via Set-DefaultAWSRegion before running this cmdlet."
8+ }
9+
10+ function _deployRepository ()
11+ {
12+ $pipelineSourceConfig = (Get-CPPipeline ExploringAspNetCore- Part2).Stages[0 ].Actions[0 ].Configuration
13+ $bucketName = $pipelineSourceConfig [" S3Bucket" ]
14+ $s3Key = $pipelineSourceConfig [" S3ObjectKey" ]
15+
16+ Write-Host ' Zipping Repository'
17+ Add-Type - assembly " system.io.compression.filesystem"
18+ $destination = [System.io.Path ]::Combine([System.io.Path ]::GetTempPath(), ' aws-blog-net-exploring-aspnet-core.zip' )
19+ If (Test-Path $destination )
20+ {
21+ Remove-Item $destination
22+ }
23+
24+ Write-Host ' Zipping up repository for initial deployment in pipeline'
25+ [io.compression.zipfile ]::CreateFromDirectory($PSScriptRoot , $destination )
26+
27+ Write-Host ' Writing zip to S3 ' $bucketName
28+ Write-S3Object - BucketName $bucketName - File $destination - Key $s3Key
29+
30+ $bucketName
31+ }
32+
33+
34+ _deployRepository
You can’t perform that action at this time.
0 commit comments