@@ -36,6 +36,7 @@ function usage {
36
36
echo " -a Used to specify an artifact output directory."
37
37
echo " Options:"
38
38
echo " -l IMAGE Used to override the default local agent image."
39
+ echo " -r Used to specify a report output directory."
39
40
echo " -s Used to specify source information. Defaults to the current working directory for primary source."
40
41
echo " * First (-s) is for primary source"
41
42
echo " * Use additional (-s) in <sourceIdentifier>:<sourceLocation> format for secondary source"
@@ -61,10 +62,11 @@ awsconfig_flag=false
61
62
mount_src_dir_flag=false
62
63
docker_privileged_mode_flag=false
63
64
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
65
66
case $opt in
66
67
i ) image_flag=true; image_name=$OPTARG ;;
67
68
a ) artifact_flag=true; artifact_dir=$OPTARG ;;
69
+ r ) report_dir=$OPTARG ;;
68
70
b ) buildspec=$OPTARG ;;
69
71
c ) awsconfig_flag=true;;
70
72
m ) mount_src_dir_flag=true;;
95
97
exit 1
96
98
fi
97
99
98
- docker_command=" docker run "
100
+ docker_command=" docker run -it "
99
101
if isOSWindows
100
102
then
101
103
docker_command+=" -v //var/run/docker.sock:/var/run/docker.sock -e "
106
108
docker_command+=" \" IMAGE_NAME=$image_name \" -e \
107
109
\" ARTIFACTS=$( allOSRealPath " $artifact_dir " ) \" "
108
110
111
+ if [ -n " $report_dir " ]
112
+ then
113
+ docker_command+=" -e \" REPORTS=$( allOSRealPath " $report_dir " ) \" "
114
+ fi
115
+
109
116
if [ -z " $source_dirs " ]
110
117
then
111
118
docker_command+=" -e \" SOURCE=$( allOSRealPath " $PWD " ) \" "
@@ -176,7 +183,12 @@ else
176
183
docker_command+=" -e \" INITIATOR=$USER \" "
177
184
fi
178
185
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
180
192
181
193
# Note we do not expose the AWS_SECRET_ACCESS_KEY or the AWS_SESSION_TOKEN
182
194
exposed_command=$docker_command
0 commit comments