Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added get-codebuild-build-log to help with debugging failing codebuil… #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions alias
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,37 @@ revoke-my-ip-all =
!f() {
aws revoke-my-ip ${1} all all
}; f

codebuild-get-latest-id =
!f() {
if [ "${1}" == "" ]; then
echo "Please enter the codebuild project name"
exit 1
else
project_name="${1}"
fi
aws codebuild list-builds-for-project \
--project-name ${project_name} --query 'ids[0]' --output text |cut -d: -f2
}; f


codebuild-tail-log =
!f() {
if [ "${1}" == "" ]; then
echo "Please enter the codebuild project name"
exit 1
else
log_group_name="/aws/codebuild/${1}"
fi
if [ "${2}" == "" ]; then
echo "Getting the latest build id for codebuild project name ${1}"
log_stream_name=$(aws codebuild-get-latest-id ${1})
echo "latest build id/log stream name=${log_stream_name}"
else
log_stream_name="${2}"
fi
aws logs get-log-events \
--log-group-name ${log_group_name} \
--log-stream-name ${log_stream_name} \
--output text | cut -f3- | sed '/^$/d'
}; f