-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathinstall-ecs-cli.sh
executable file
·37 lines (32 loc) · 1.26 KB
/
install-ecs-cli.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
#!/bin/bash
######################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# SPDX-License-Identifier: MIT-0 #
######################################################################
if [ -e .env ]; then
. .env
elif [ -e ../.env ]; then
pushd ..
. .env
popd
fi
if [ "$OPERATING_SYSTEM" == "Linux" ]; then
echo "Installing ecs-cli on Linux ..."
sudo curl -Lo /usr/local/bin/ecs-cli https://amazon-ecs-cli.s3.amazonaws.com/ecs-cli-linux-amd64-latest
gpg --import ./gpg-public-key
curl -Lo ecs-cli.asc https://amazon-ecs-cli.s3.amazonaws.com/ecs-cli-linux-amd64-latest.asc
gpg --verify ecs-cli.asc /usr/local/bin/ecs-cli
sudo chmod +x /usr/local/bin/ecs-cli
ecs-cli --version
elif [ "$OPERATING_SYSTEM" == "MacOS" ]; then
echo "Installing ecs-cli on MacOS ..."
sudo curl -Lo /usr/local/bin/ecs-cli https://amazon-ecs-cli.s3.amazonaws.com/ecs-cli-darwin-amd64-latest
brew install gnupg
gpg --import ./gpg-public-key
curl -Lo ecs-cli.asc https://amazon-ecs-cli.s3.amazonaws.com/ecs-cli-darwin-amd64-latest.asc
gpg --verify ecs-cli.asc /usr/local/bin/ecs-cli
sudo chmod +x /usr/local/bin/ecs-cli
ecs-cli --version
else
echo "Unrecognized OS $OPERATING_SYSTEM"
fi