Skip to content

Instantly share code, notes, and snippets.

View andrewlorien's full-sized avatar

andrew lorien andrewlorien

View GitHub Profile
#!/bin/bash
applicationName=$1
deploymentGroupName=$2
currentDeploymentId=$(aws deploy list-deployments --application-name $applicationName --deployment-group-name $deploymentGroupName --max-items 10 --include-only-statuses "Succeeded" --output json | jq --raw-output '.deployments[0]' )
previousRevisionSha=$(aws deploy get-deployment --deployment-id $currentDeploymentId --output json | jq --raw-output '.deploymentInfo.previousRevision.string.sha256')
result=$(aws deploy create-deployment --application-name $applicationName --deployment-group-name $applicationName --deployment-config-name CodeDeployDefault.ECSAllAtOnce --description "Rollback to the previous deployment" --revision revisionType=String,string="{sha256=${previousRevisionSha}}" --output json)
echo Deployment started: $result
@chrismdp
chrismdp / s3.sh
Last active March 5, 2024 12:57
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1