@@ -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 " ) \" "
@@ -136,11 +143,6 @@ then
136143 docker_command+=" -v \" $environment_variable_file_dir :/LocalBuild/envFile/\" -e \" ENV_VAR_FILE=$environment_variable_file_basename \" "
137144fi
138145
139- if [ -n " $local_agent_image " ]
140- then
141- docker_command+=" -e \" LOCAL_AGENT_IMAGE_NAME=$local_agent_image \" "
142- fi
143-
144146if $awsconfig_flag
145147then
146148 if [ -d " $HOME /.aws" ]
@@ -176,7 +178,12 @@ else
176178 docker_command+=" -e \" INITIATOR=$USER \" "
177179fi
178180
179- docker_command+=" amazon/aws-codebuild-local:latest"
181+ if [ -n " $local_agent_image " ]
182+ then
183+ docker_command+=" $local_agent_image "
184+ else
185+ docker_command+=" public.ecr.aws/codebuild/local-builds:latest"
186+ fi
180187
181188# Note we do not expose the AWS_SECRET_ACCESS_KEY or the AWS_SESSION_TOKEN
182189exposed_command=$docker_command
@@ -191,4 +198,4 @@ echo ""
191198echo $exposed_command
192199echo " "
193200
194- eval $docker_command
201+ eval $docker_command
0 commit comments