Skip to content

Commit ef3136e

Browse files
authored
Merge pull request #410 from xinyu-aws/201204_support_test_reports
Add option for supporting test reports
2 parents 407e029 + 1762fa0 commit ef3136e

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

local_builds/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Download and use our codebuild_build.sh script to run your local builds.
2424

2525
**Optional:**
2626
-l Used to override the default local agent image.
27+
-r Used to specify a report output directory.
2728
-c Use the AWS configuration and credentials from your local host. This includes ~/.aws and any AWS_* environment variables.
2829
-p Used to specify the AWS CLI Profile.
2930
-b Used to specify a buildspec override file. Defaults to buildspec.yml in the source directory.

local_builds/codebuild_build.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ function usage {
3535
echo " -a Used to specify an artifact output directory."
3636
echo "Options:"
3737
echo " -l IMAGE Used to override the default local agent image."
38+
echo " -r Used to specify a report output directory."
3839
echo " -s Used to specify source information. Defaults to the current working directory for primary source."
3940
echo " * First (-s) is for primary source"
4041
echo " * Use additional (-s) in <sourceIdentifier>:<sourceLocation> format for secondary source"
@@ -60,10 +61,11 @@ awsconfig_flag=false
6061
mount_src_dir_flag=false
6162
docker_privileged_mode_flag=false
6263

63-
while getopts "cmdi:a:s:b:e:l:p:h" opt; do
64+
while getopts "cmdi:a:r:s:b:e:l:p:h" opt; do
6465
case $opt in
6566
i ) image_flag=true; image_name=$OPTARG;;
6667
a ) artifact_flag=true; artifact_dir=$OPTARG;;
68+
r ) report_dir=$OPTARG;;
6769
b ) buildspec=$OPTARG;;
6870
c ) awsconfig_flag=true;;
6971
m ) mount_src_dir_flag=true;;
@@ -105,6 +107,11 @@ fi
105107
docker_command+="\"IMAGE_NAME=$image_name\" -e \
106108
\"ARTIFACTS=$(allOSRealPath "$artifact_dir")\""
107109

110+
if [ -n "$report_dir" ]
111+
then
112+
docker_command+=" -e \"REPORTS=$(allOSRealPath "$report_dir")\""
113+
fi
114+
108115
if [ -z "$source_dirs" ]
109116
then
110117
docker_command+=" -e \"SOURCE=$(allOSRealPath "$PWD")\""

0 commit comments

Comments
 (0)