Skip to content

Commit af87dff

Browse files
Merge pull request #104 from aws/ci_improvement_test_image_push
Add CI improvement
2 parents 5842f08 + f21e8be commit af87dff

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

ci/buildspec.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,18 @@ phases:
2727
commands:
2828
- echo Build completed on `date`
2929
- echo Pushing the Docker image...
30-
- docker push 515193369038.dkr.ecr.us-west-2.amazonaws.com/sagemaker-scikit-learn:$FRAMEWORK_VERSION-cpu-py3
30+
- |
31+
case $CODEBUILD_WEBHOOK_EVENT in
32+
PULL_REQUEST_MERGED)
33+
docker push 515193369038.dkr.ecr.us-west-2.amazonaws.com/sagemaker-scikit-learn:$FRAMEWORK_VERSION-cpu-py3 | grep -v -E "[0-9]{12}.dkr.ecr.\S+.amazonaws.com"
34+
;;
35+
PULL_REQUEST_CREATED | PULL_REQUEST_UPDATED | PULL_REQUEST_REOPENED)
36+
# pushes test tag for manual verification, requires cleanup in ECR every once in a while though
37+
TEST_TAG=515193369038.dkr.ecr.us-west-2.amazonaws.com/sagemaker-scikit-learn:$FRAMEWORK_VERSION-cpu-py3-test
38+
docker tag preprod-sklearn:$FRAMEWORK_VERSION-cpu-py3 ${TEST_TAG}
39+
docker push ${TEST_TAG} | grep -v -E "[0-9]{12}.dkr.ecr.\S+.amazonaws.com"
40+
;;
41+
*)
42+
echo Undefined behavior for webhook event type $CODEBUILD_WEBHOOK_EVENT
43+
;;
44+
esac

0 commit comments

Comments
 (0)