@@ -36,6 +36,7 @@ function usage {
3636 echo " -a Used to specify an artifact output directory."
3737 echo " Options:"
3838 echo " -l IMAGE Used to override the default local agent image."
39+ echo " -r Used to specify a report output directory."
3940 echo " -s Used to specify source information. Defaults to the current working directory for primary source."
4041 echo " * First (-s) is for primary source"
4142 echo " * Use additional (-s) in <sourceIdentifier>:<sourceLocation> format for secondary source"
@@ -61,10 +62,11 @@ awsconfig_flag=false
6162mount_src_dir_flag=false
6263docker_privileged_mode_flag=false
6364
64- while getopts " cmdi:a:s:b:e:l:p:h" opt; do
65+ while getopts " cmdi:a:r: s:b:e:l:p:h" opt; do
6566 case $opt in
6667 i ) image_flag=true; image_name=$OPTARG ;;
6768 a ) artifact_flag=true; artifact_dir=$OPTARG ;;
69+ r ) report_dir=$OPTARG ;;
6870 b ) buildspec=$OPTARG ;;
6971 c ) awsconfig_flag=true;;
7072 m ) mount_src_dir_flag=true;;
106108docker_command+=" \" IMAGE_NAME=$image_name \" -e \
107109 \" ARTIFACTS=$( allOSRealPath " $artifact_dir " ) \" "
108110
111+ if [ -n " $report_dir " ]
112+ then
113+ docker_command+=" -e \" REPORTS=$( allOSRealPath " $report_dir " ) \" "
114+ fi
115+
109116if [ -z " $source_dirs " ]
110117then
111118 docker_command+=" -e \" SOURCE=$( allOSRealPath " $PWD " ) \" "
@@ -176,7 +183,12 @@ else
176183 docker_command+=" -e \" INITIATOR=$USER \" "
177184fi
178185
179- docker_command+=" amazon/aws-codebuild-local:latest"
186+ if [ -n " $local_agent_image " ]
187+ then
188+ docker_command+=" $local_agent_image "
189+ else
190+ docker_command+=" public.ecr.aws/codebuild/local-builds:latest"
191+ fi
180192
181193# Note we do not expose the AWS_SECRET_ACCESS_KEY or the AWS_SESSION_TOKEN
182194exposed_command=$docker_command
0 commit comments