-
Notifications
You must be signed in to change notification settings - Fork 26
/
push-public-ecr.sh
executable file
·72 lines (58 loc) · 3.2 KB
/
push-public-ecr.sh
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
#!/usr/bin/env bash
export REGION='us-east-1'
get_repo_link() {
repository_exists=$(aws ecr-public describe-repositories --repository-names $1 --region ${REGION} --query 'repositories[0].repositoryUri' --output text 2>&1)
if [[ $? -eq 0 ]]; then
# Repository exists, extract the repositoryUri
repositoryUri=$repository_exists
echo $repositoryUri
else
# Repository doesn't exist, create it and extract the repositoryUri
output=$(aws ecr-public create-repository --repository-name $1 --region ${REGION} --no-cli-pager)
repositoryUri=$(echo $output | jq -r '.repository.repositoryUri')
echo $repositoryUri
fi
}
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws
repo_uri=$(get_repo_link springcommunity/spring-petclinic-api-gateway)
echo "REPO is" ${repo_uri}
docker tag springcommunity/spring-petclinic-api-gateway:latest ${repo_uri}:latest
docker push ${repo_uri}:latest
repo_uri=$(get_repo_link springcommunity/spring-petclinic-discovery-server )
docker tag springcommunity/spring-petclinic-discovery-server:latest ${repo_uri}:latest
docker push ${repo_uri}:latest
repo_uri=$(get_repo_link springcommunity/spring-petclinic-config-server )
docker tag springcommunity/spring-petclinic-config-server:latest ${repo_uri}:latest
docker push ${repo_uri}:latest
repo_uri=$(get_repo_link springcommunity/spring-petclinic-visits-service )
docker tag springcommunity/spring-petclinic-visits-service:latest ${repo_uri}:latest
docker push ${repo_uri}:latest
repo_uri=$(get_repo_link springcommunity/spring-petclinic-vets-service )
docker tag springcommunity/spring-petclinic-vets-service:latest ${repo_uri}:latest
docker push ${repo_uri}:latest
repo_uri=$(get_repo_link springcommunity/spring-petclinic-customers-service )
docker tag springcommunity/spring-petclinic-customers-service:latest ${repo_uri}:latest
docker push ${repo_uri}:latest
repo_uri=$(get_repo_link springcommunity/spring-petclinic-admin-server )
docker tag springcommunity/spring-petclinic-admin-server:latest ${repo_uri}:latest
docker push ${repo_uri}:latest
repo_uri=$(get_repo_link python-petclinic-insurance-service )
docker build -t insurance-service ./pet_clinic_insurance_service --no-cache
docker tag insurance-service:latest ${repo_uri}:latest
docker push ${repo_uri}:latest
repo_uri=$(get_repo_link python-petclinic-billing-service )
docker build -t billing-service ./pet_clinic_billing_service --no-cache
docker tag billing-service:latest ${repo_uri}:latest
docker push ${repo_uri}:latest
repo_uri=$(get_repo_link nodejs-petclinic-nutrition-service )
docker build -t nutrition-service ./pet-nutrition-service --no-cache
docker tag nutrition-service:latest ${repo_uri}:latest
docker push ${repo_uri}:latest
repo_uri=$(get_repo_link traffic-generator )
docker build -t traffic-generator ./traffic-generator --no-cache
docker tag traffic-generator:latest ${repo_uri}:latest
docker push ${repo_uri}:latest
repo_uri=$(get_repo_link dotnet-petclinic-payment )
docker build -t dotnet-petclinic-payment ./dotnet-petclinic-payment/PetClinic.PaymentService --no-cache
docker tag dotnet-petclinic-payment:latest ${repo_uri}:latest
docker push ${repo_uri}:latest