forked from aws-samples/web-scraping-example-with-ecs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·39 lines (16 loc) · 961 Bytes
/
setup.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
#!/bin/bash
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
set -e
AWS_ACCOUNT_ID=$(aws sts get-caller-identity --output text --query 'Account')
AWS_REGION=$(aws configure get region)
read -p "Enter the name of the bucket that will be created to store your output: " S3_BUCKET_NAME
aws s3 mb s3://$S3_BUCKET_NAME
aws ecr create-repository \
--repository-name demo/selenium-ecs
aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com
docker build -t demo/selenium-ecs .
docker tag demo/selenium-ecs:latest $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/demo/selenium-ecs:latest
docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/demo/selenium-ecs:latest
echo Image URL: $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/demo/selenium-ecs:latest
echo Bucket S3: $S3_BUCKET_NAME