forked from 9652040795/aws-policies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jenkinsx
97 lines (55 loc) · 3.23 KB
/
jenkinsx
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
#!/bin/bash
#OS:Amazon-Linux+Ubuntu
#Prerequisite:Do Not Attach an IAM Role, use YOUR Account Progmatic Secret Key & Access Key
#Owner: Muhammad Asim ---> [email protected]
# Terraform Setup
apt update -y && apt install -y curl 2>&1 > /dev/null
curl -# -LO https://releases.hashicorp.com/terraform/0.12.16/terraform_0.12.16_linux_amd64.zip
apt update -y && apt install -y unzip 2>&1 >/dev/null
unzip terraform_0.12.16_linux_amd64.zip
rm -rf *.zip
cp terraform /usr/bin/ 2>&1 > /dev/null
cp terraform /usr/local/bin 2>&1 > /dev/null
rm -rf terraform
# Install AWS Cli
apt update -y 2>&1 > /dev/null
apt install awscli -y 2>&1 > /dev/null
apt install python3-pip -y 2>&1 > /dev/null
pip3 install --upgrade --user awscli 2>&1 > /dev/null
# Kubectl Installation
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
mv ./kubectl /usr/bin/kubectl 2>&1 > /dev/null
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
mv ./kubectl /usr/local/bin/kubectl 2>&1 > /dev/null
# IAM authenticator
# Installing AWS IAM authenticator ---> (This allows us to administor our EKS Clustor, using our IAM Identity)
# https://github.com/kubernetes-sigs/aws-iam-authenticator
# We are using the AWS Version of IAM authenticator ---> https://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html
# Download the Amazon EKS-vended aws-iam-authenticator binary from Amazon S3
# curl -o aws-iam-authenticator https://amazon-eks.s3-us-west-2.amazonaws.com/1.14.6/2019-08-22/bin/linux/amd64/aws-iam-authenticator
curl -o aws-iam-authenticator https://amazon-eks.s3-us-west-2.amazonaws.com/1.14.6/2019-08-22/bin/linux/amd64/aws-iam-authenticator
chmod +x ./aws-iam-authenticator
mkdir -p $HOME/bin && cp ./aws-iam-authenticator $HOME/bin/aws-iam-authenticator && export PATH=$HOME/bin:$PATH
cp ./aws-iam-authenticator /usr/local/bin/aws-iam-authenticator && export PATH=$HOME/usr/local/bin:$PATH 2>&1 > /dev/null
echo 'export PATH=$HOME/usr/local/bin:$PATH' >> ~/.bashrc 2>&1 > /dev/null
rm -rf aws-iam-authenticator 2>&1 > /dev/null
# aws-iam-authenticator help
# JenkinsX Binary JX
curl -L "https://github.com/jenkins-x/jx/releases/download/$(curl --silent "https://github.com/jenkins-x/jx/releases/latest" | sed 's#.*tag/\(.*\)\".*#\1#')/jx-linux-amd64.tar.gz" | tar xzv "jx"
cp jx /usr/local/bin 2>&1 > /dev/null
cp jx /usr/bin 2>&1 > /dev/null
yum install -y git 2>&1 > /dev/null
apt install -y git 2>&1 > /dev/null
rm -rf jx
curl --silent --location "https://github.com/weaveworks/eksctl/releases/download/latest_release/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp
cp /tmp/eksctl /usr/local/bin 2>&1 > /dev/null
cp /tmp/eksctl /usr/bin 2>&1 > /dev/null
curl -# -LO https://github.com/quickbooks2018/aws/raw/master/helm-v2.16.1-linux-amd64.tar.gz
tar -xzvf helm-v2.16.1-linux-amd64.tar.gz
cp linux-amd64/helm /usr/local/bin 2>&1 > /dev/null
cp linux-amd64/helm /usr/bin 2>&1 > /dev/null
rm -rf linux-amd64
mv helm-v2.16.1-linux-amd64.tar.gz /tmp
#END