Skip to content

Commit 98becc7

Browse files
laurenyuknakad
authored andcommitted
infra: properly fail build if has-matching-changes fails (#154)
1 parent f21d9e4 commit 98becc7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

buildspec.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,11 @@ phases:
7474
- create-key-pair
7575
- launch-ec2-instance --instance-type $instance_type --ami-name dlami-ubuntu
7676

77+
- HAS_MATCHING_CHANGES_OUTPUT=$(has-matching-changes "test/" "tests/" "src/*.py" "setup.py" "setup.cfg" "docker/*" "buildspec.yml")
78+
7779
# run cpu integration tests
7880
- |
79-
if has-matching-changes "test/" "tests/" "src/*.py" "docker/*" "buildspec.yml"; then
81+
if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then
8082
pytest test/integration/local --region $AWS_DEFAULT_REGION --docker-base-name $PREPROD_IMAGE --framework-version $FRAMEWORK_VERSION --py-version $CPU_PY3_VERSION --processor cpu --tag $CPU_PY3_TAG
8183
pytest test/integration/local --region $AWS_DEFAULT_REGION --docker-base-name $PREPROD_IMAGE --framework-version $FRAMEWORK_VERSION --py-version $CPU_PY2_VERSION --processor cpu --tag $CPU_PY2_TAG
8284
else
@@ -85,7 +87,7 @@ phases:
8587
8688
# run gpu integration tests
8789
- |
88-
if has-matching-changes "test/" "tests/" "src/*.py" "docker/*" "buildspec.yml"; then
90+
if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then
8991
printf "$SETUP_CMDS" > $SETUP_FILE
9092
py3_cmd="pytest test/integration/local --region $AWS_DEFAULT_REGION --docker-base-name $PREPROD_IMAGE --framework-version $FRAMEWORK_VERSION --py-version $GPU_PY3_VERSION --processor gpu --tag $GPU_PY3_TAG"
9193
py2_cmd="pytest test/integration/local --region $AWS_DEFAULT_REGION --docker-base-name $PREPROD_IMAGE --framework-version $FRAMEWORK_VERSION --py-version $GPU_PY2_VERSION --processor gpu --tag $GPU_PY2_TAG"
@@ -97,7 +99,7 @@ phases:
9799
98100
# run cpu sagemaker tests
99101
- |
100-
if has-matching-changes "test/" "tests/" "src/*.py" "docker/*" "buildspec.yml"; then
102+
if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then
101103
pytest test/integration/sagemaker --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --aws-id $ACCOUNT --framework-version $FRAMEWORK_VERSION --py-version $CPU_PY3_VERSION --processor cpu --instance-type $CPU_INSTANCE_TYPE --tag $CPU_PY3_TAG
102104
pytest test/integration/sagemaker --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --aws-id $ACCOUNT --framework-version $FRAMEWORK_VERSION --py-version $CPU_PY2_VERSION --processor cpu --instance-type $CPU_INSTANCE_TYPE --tag $CPU_PY2_TAG
103105
else
@@ -106,7 +108,7 @@ phases:
106108
107109
# run gpu sagemaker tests
108110
- |
109-
if has-matching-changes "test/" "tests/" "src/*.py" "docker/*" "buildspec.yml"; then
111+
if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then
110112
pytest test/integration/sagemaker --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --aws-id $ACCOUNT --framework-version $FRAMEWORK_VERSION --py-version $GPU_PY3_VERSION --processor gpu --instance-type $GPU_INSTANCE_TYPE --tag $GPU_PY3_TAG
111113
pytest test/integration/sagemaker --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --aws-id $ACCOUNT --framework-version $FRAMEWORK_VERSION --py-version $CPU_PY2_VERSION --processor cpu --instance-type $CPU_INSTANCE_TYPE --tag $GPU_PY2_TAG
112114
else

0 commit comments

Comments
 (0)