-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
up_cluster
executable file
·48 lines (34 loc) · 1.05 KB
/
up_cluster
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
#!/bin/bash
AWS_REGION=us-east-2
AWS_ACCOUNT_ID=471112630933
ECR_REGISTRY_IMAGE=radish
IMAGE_TAG_NAME=latest
echo "hello world"
# ls -l .
# aws ec2 start
# for i in $(seq 1 2)
# do
# # aws ec2 status
# # echo "Waiting for ec2"
# sleep 1
# done
echo "to do ec2 start withmounted confs"
# while true;
# do
# # Capture the fifth column output in a variable
# status=$(docker ps | grep moby | awk '{print $5}')
# # Echo the variable
# echo "$status"
# if [[ "$status" == "0" ]]; then
# echo "up"
# break
# else
# echo "Waiting, current status $status"
# echo "Sleeping for 5 seconds..."
# sleep 5
# fi
# done
# docker pull redis:latest
aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com
docker tag radish:latest $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$ECR_REGISTRY_IMAGE:$IMAGE_TAG_NAME
docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$ECR_REGISTRY_IMAGE:$IMAGE_TAG_NAME