-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprovision.sh
112 lines (89 loc) · 3.41 KB
/
provision.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/usr/bin/env bash
sudo apt-get update -y && sudo apt-get -y upgrade
sudo apt-get install -y unzip curl git jq ccrypt
#JAVA & PYTHON
sudo apt-get install -y openjdk-8-jdk python3-pip maven
#Extract distro name
grep -qxF 'ID=ubuntu' /etc/os-release && export DISTRO=ubuntu
grep -qxF 'ID=debian' /etc/os-release && export DISTRO=debian
#GRADLE
if [[ ! -d /opt/gradle ]]
then
wget https://services.gradle.org/distributions/gradle-5.4.1-bin.zip -P /tmp
sudo unzip -d /opt/gradle -o /tmp/gradle-5.4.1-bin.zip
rm /tmp/gradle-5.4.1-bin.zip
printf "export GRADLE_HOME=/opt/gradle/gradle-5.4.1\nexport PATH=\${GRADLE_HOME}/bin:\${PATH}" | sudo tee /etc/profile.d/gradle.sh
sudo chmod +x /etc/profile.d/gradle.sh
fi
#AWS Cli
if [[ ! -e /usr/local/bin/aws ]]
then
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
unzip awscli-bundle.zip
sudo python3 awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
rm awscli-bundle.zip -f
fi
if [[ ! -e /usr/local/bin/session-manager-plugin ]]
then
curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" -o "session-manager-plugin.deb"
sudo dpkg -i session-manager-plugin.deb
rm session-manager-plugin.deb -f
fi
###############################################################################
#Install ec2sh
#Ref: https://github.schibsted.io/scmspain/tools-common--awesome/tree/master/ec2sh
#AWLESS https://github.com/wallix/awless
if [[ ! -e /opt/awless/bin ]]
then
curl https://raw.githubusercontent.com/wallix/awless/master/getawless.sh | bash
sudo mkdir -p /opt/awless/bin
sudo mv awless /opt/awless/bin
printf "export PATH=/opt/awless/bin:\${PATH}" | sudo tee /etc/profile.d/awless.sh
sudo chmod +x /etc/profile.d/awless.sh
fi
#SBT
wget https://dl.bintray.com/sbt/debian/sbt-1.2.8.deb
sudo dpkg -i sbt-1.2.8.deb
rm sbt-1.2.8.deb -f
#gimme-aws-creds
if [[ ! -e /usr/local/bin/gimme-aws-creds ]]; then
echo "Installing gimme-aws-creds..."
sudo pip3 install --upgrade gimme-aws-creds
if [[ $DISTRO == "debian" ]]; then
sudo pip3 install --upgrade keyrings.alt
fi
fi
#Docker
if [[ $DISTRO == "ubuntu" ]]
then
echo "Installing docker..."
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
elif [[ $DISTRO == "debian" ]]
then
echo "Installing docker..."
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
fi
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose
sudo usermod -aG docker $USER
echo "Installing kubectl..."
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
#Clean and remove history
sudo apt-get clean
cat /dev/null > ~/.bash_history && history -c && exit
#Travis client
#https://github.com/travis-ci/travis.rb#installation
gem install pry
gem install travis -v 1.8.10 --no-rdoc --no-ri