-
Notifications
You must be signed in to change notification settings - Fork 8
/
install-packages-instance
executable file
·56 lines (41 loc) · 2.12 KB
/
install-packages-instance
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
#!/bin/bash
set -e
set -x
echo "Installing packages for AWS codebuild environment"
aws sts get-caller-identity
SOURCE=${BASH_SOURCE[0]} # resolve the script dir even if a symlink is used to this script
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
SOURCE=$(readlink "$SOURCE")
[[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
SCRIPTDIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
cd $SCRIPTDIR
SUDOCMD="sudo" # replace with text sudo to use elevated permissions
# $SUDOCMD yum install -y sudo
# # This fixes yum update problems with codebuild
# $SUDOCMD yum install -y yum-utils
# $SUDOCMD yum remove -y libuv-1.39.0-1.amzn2.x86_64
# $SUDOCMD yum clean all
# $SUDOCMD rm -rf /var/cache/yum
# $SUDOCMD yum update -y
# $SUDOCMD yum install -y python
# $SUDOCMD yum install -y python3.8
# $SUDOCMD yum install -y python3-pip # for a specific python version - https://realpython.com/intro-to-pyenv/
# $SUDOCMD yum install -y jq
echo "Set ownership to ec2-user for: $SCRIPTDIR"
$SUDOCMD chown -R ec2-user:ec2-user $SCRIPTDIR
echo "Create tmp dir: $SCRIPTDIR/tmp"
mkdir -p $SCRIPTDIR/tmp
# wget https://releases.hashicorp.com/terraform/0.13.7/terraform_0.13.7_linux_amd64.zip -P /tmp/ --quiet # Get terraform
# $SUDOCMD unzip /tmp/terraform_0.13.7_linux_amd64.zip -d /tmp/
# $SUDOCMD mv /tmp/terraform /usr/local/bin/.
# wget https://releases.hashicorp.com/packer/1.7.2/packer_1.7.2_linux_amd64.zip -P /tmp/ --quiet # Get Packer
# $SUDOCMD unzip /tmp/packer_1.7.2_linux_amd64.zip -d /tmp/
# $SUDOCMD mv /tmp/packer /usr/local/bin/.
# wget https://github.com/gruntwork-io/terragrunt/releases/download/v0.30.3/terragrunt_linux_386 -P /tmp/ --quiet # Get Terragrunt
# $SUDOCMD mv /tmp/terragrunt_linux_386 /usr/local/bin/terragrunt
# $SUDOCMD chmod +x /usr/local/bin/terragrunt
mkdir -p "$HOME/.ssh/tls" # The directory to store TLS certificates in.
# echo "Resizing EBS volume..."
# $SCRIPTDIR/deploy/firehawk-main/scripts/resize.sh