#!/bin/bash set -euo pipefail commit=${CODEBUILD_RESOLVED_SOURCE_VERSION:-} # CODEBUILD_RESOLVED_SOURCE_VERSION is not defined (i.e. local build or CodePipeline build), # use the HEAD commit hash if [ -z "${commit}" ]; then commit="$(git rev-parse --verify HEAD)" fi cat > build-info.json <