Skip to content

Instantly share code, notes, and snippets.

@davyngugi
Last active June 13, 2019 12:38
Show Gist options
  • Save davyngugi/7c3b325aaa4177150143eeccb8e6b347 to your computer and use it in GitHub Desktop.
Save davyngugi/7c3b325aaa4177150143eeccb8e6b347 to your computer and use it in GitHub Desktop.
Grab the git commit hash from the downloaded bundle by aws codedeploy agent
#!/bin/bash
DIR=`tar -tzf bundle.tar | head -1 | cut -f1 -d"/"`
echo $DIR
IFS='-'
read -ra ADDR <<< "$DIR"
echo "${ADDR[-1]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment