Skip to content

Commit cda20c1

Browse files
laurenyuknakad
authored andcommitted
infra: properly fail build if has-matching-changes fails (#34)
1 parent d021b27 commit cda20c1

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
@@ -76,9 +76,11 @@ phases:
7676
- create-key-pair
7777
- launch-ec2-instance --instance-type $instance_type --ami-name dlami-ubuntu
7878

79+
- HAS_MATCHING_CHANGES_OUTPUT=$(has-matching-changes "test/" "tests/" "src/*.py" "setup.py" "setup.cfg" "docker/*" "buildspec.yml")
80+
7981
# run cpu integration tests
8082
- |
81-
if has-matching-changes "test/" "tests/" "src/*.py" "docker/*" "buildspec.yml"; then
83+
if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then
8284
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
8385
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
8486
else
@@ -87,7 +89,7 @@ phases:
8789
8890
# run gpu integration tests
8991
- |
90-
if has-matching-changes "test/" "tests/" "src/*.py" "docker/*" "buildspec.yml"; then
92+
if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then
9193
printf "$SETUP_CMDS" > $SETUP_FILE
9294
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"
9395
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"
@@ -99,7 +101,7 @@ phases:
99101
100102
# run cpu sagemaker tests
101103
- |
102-
if has-matching-changes "test/" "tests/" "src/*.py" "docker/*" "buildspec.yml"; then
104+
if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then
103105
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
104106
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
105107
else
@@ -108,7 +110,7 @@ phases:
108110
109111
# run gpu sagemaker tests
110112
- |
111-
if has-matching-changes "test/" "tests/" "src/*.py" "docker/*" "buildspec.yml"; then
113+
if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then
112114
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
113115
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
114116
else

0 commit comments

Comments
 (0)