Created
May 1, 2017 22:40
-
-
Save chedabob/36f9313cf69956de4ab5c4415b582ff3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module AWSPowerShell | |
Set-AWSCredentials -ProfileName default -ProfilesLocation C:\aws-creds\<redacted>-live | |
Set-DefaultAWSRegion -Region eu-west-2 | |
$s3Bucket = "<redacted>" | |
$filename = ($OctopusParameters['Octopus.Release.Number'] + ".zip") | |
Write-Host 'Write application bundle to S3' | |
# Determine S3 bucket to store application bundle | |
Write-S3Object -BucketName $s3Bucket -File $OctopusParameters['Octopus.Action[Package live for AWS].Output.PayloadPath'] -Key $filename | |
$applicationName = "<redacted>" | |
$environmentName = "live" | |
$versionLabel = $OctopusParameters['Octopus.Release.Number'] | |
Write-Host 'Update Beanstalk environment for new application bundle' | |
New-EBApplicationVersion -ApplicationName $applicationName -VersionLabel $versionLabel -SourceBundle_S3Bucket $s3Bucket -SourceBundle_S3Key $filename | |
Update-EBEnvironment -ApplicationName $applicationName -EnvironmentName $environmentName -VersionLabel $versionLabel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment