-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathbuildspec.template.yml
More file actions
80 lines (79 loc) · 3.87 KB
/
buildspec.template.yml
File metadata and controls
80 lines (79 loc) · 3.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
version: 0.2
phases:
pre_build:
commands:
- echo Logging in to Amazon ECR...
- $(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION)
- $(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION --registry-ids 763104351884)
- $(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION --registry-ids 217643126080)
- $(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION --registry-ids 727897471807)
- $(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION --registry-ids 626614931356)
# Since a lot of accounts are listed under the following, we'll only log in to the one(s) for our region:
# https://docs.aws.amazon.com/sagemaker/latest/dg/pre-built-docker-containers-scikit-learn-spark.html
- |-
if [ "$AWS_DEFAULT_REGION" = "us-west-1" ]; then
$(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION --registry-ids 746614075791)
fi
- |-
if [ "$AWS_DEFAULT_REGION" = "us-west-2" ]; then
$(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION --registry-ids 246618743249)
fi
- |-
if [ "$AWS_DEFAULT_REGION" = "us-east-1" ]; then
$(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION --registry-ids 683313688378)
fi
- |-
if [ "$AWS_DEFAULT_REGION" = "us-east-2" ]; then
$(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION --registry-ids 257758044811)
fi
- |-
if [ "$AWS_DEFAULT_REGION" = "ap-northeast-1" ]; then
$(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION --registry-ids 354813040037)
fi
- |-
if [ "$AWS_DEFAULT_REGION" = "ap-northeast-2" ]; then
$(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION --registry-ids 366743142698)
fi
- |-
if [ "$AWS_DEFAULT_REGION" = "ap-southeast-1" ]; then
$(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION --registry-ids 121021644041)
fi
- |-
if [ "$AWS_DEFAULT_REGION" = "ap-southeast-2" ]; then
$(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION --registry-ids 783357654285)
fi
- |-
if [ "$AWS_DEFAULT_REGION" = "ap-south-1" ]; then
$(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION --registry-ids 720646828776)
fi
- |-
if [ "$AWS_DEFAULT_REGION" = "eu-west-1" ]; then
$(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION --registry-ids 141502667606)
fi
- |-
if [ "$AWS_DEFAULT_REGION" = "eu-west-2" ]; then
$(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION --registry-ids 764974769150)
fi
- |-
if [ "$AWS_DEFAULT_REGION" = "eu-central-1" ]; then
$(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION --registry-ids 492215442770)
fi
- |-
if [ "$AWS_DEFAULT_REGION" = "ca-central-1" ]; then
$(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION --registry-ids 341280168497)
fi
- |-
if [ "$AWS_DEFAULT_REGION" = "us-gov-west-1" ]; then
$(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION --registry-ids 414596584902)
fi
build:
commands:
- echo Build started on `date`
- echo Building the Docker image...
- docker build -t $IMAGE_REPO_NAME:$IMAGE_TAG REPLACE_ME_BUILD_ARGS
- docker tag $IMAGE_REPO_NAME:$IMAGE_TAG $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG
post_build:
commands:
- echo Build completed on `date`
- echo Pushing the Docker image...
- docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG