-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathVagrantfile
210 lines (203 loc) · 10.2 KB
/
Vagrantfile
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
$script = <<-SCRIPT
TZ=America/Los_Angeles
ARGO_VERSION=3.2.4
ARGOCD_VERSION=2.1.7
BOSH_VERSION=6.4.9
CF_VERSION=7.4.0
CREDHUB_VERSION=2.9.0
GH_VERSION=2.3.0
GO_VERSION=1.17.4
HELM_VERSION=3.7.1
HELMFILE_VERSION=0.142.0
AWS_IAM_AUTHENTICATOR_VERSION="1.21.2/2021-07-05"
IMGPKG_VERSION=0.23.1
KAPP_VERSION=0.43.0
KBLD_VERSION=0.31.0
KIND_VERSION=0.11.1
KWT_VERSION=0.0.6
KUBECTL_VERSION=1.22.1
KNATIVE_VERSION=1.0.0
LEFTOVERS_VERSION=0.62.0
MKPCLI_VERSION=0.5.3
OM_VERSION=7.4.1
PIVNET_VERSION=3.0.1
TEKTONCD_VERSION=0.21.0
TERRAFORM_VERSION=1.1.3
TERRAFORM_DOCS_VERSION=0.16.0
TMC_VERSION=0.4.0-089ff971
VELERO_VERSION=1.7.1
VENDIR_VERSION=0.23.0
YTT_VERSION=0.38.0
mkdir downloads && cd downloads && \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \
apt update -y && \
apt install build-essential curl default-jre git gpg graphviz gzip httpie libnss3-tools jq openssl pv python3-pip python3.8-dev python3.8-venv ruby-dev snapd sudo tmux tzdata unzip vim wget -y && \
add-apt-repository ppa:cncf-buildpacks/pack-cli && \
apt install pack-cli -y && \
sudo snap install snap-store && \
sudo snap install code --classic && \
sudo snap install kontena-lens --classic && \
sudo snap install k9s && \
python3 -m pip install --user --upgrade pip && \
python3 -m pip install --user virtualenv && \
useradd -m docker && echo "docker:docker" | chpasswd && \
adduser docker sudo && \
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
sudo ./aws/install && \
curl -o aws-iam-authenticator curl -o aws-iam-authenticator "https://amazon-eks.s3.us-west-2.amazonaws.com/${AWS_IAM_AUTHENTICATOR_VERSION}/bin/linux/amd64/aws-iam-authenticator" && \
chmod +x aws-iam-authenticator && \
sudo mv aws-iam-authenticator /usr/local/bin && \
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash && \
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && \
apt update -y && apt install google-cloud-sdk -y && \
gem install cf-uaac && \
wget https://github.com/cloudfoundry/bosh-cli/releases/download/v${BOSH_VERSION}/bosh-cli-${BOSH_VERSION}-linux-amd64 && \
mv bosh-cli-${BOSH_VERSION}-linux-amd64 bosh && \
chmod +x bosh && \
sudo mv bosh /usr/local/bin && \
wget -O cf.tgz "https://packages.cloudfoundry.org/stable?release=linux64-binary&version=${CF_VERSION}&source=github-rel" && \
tar -xvf cf.tgz && \
rm -Rf cf.tgz && \
sudo mv cf7 cf && \
sudo mv cf /usr/local/bin && \
wget https://github.com/cloudfoundry-incubator/credhub-cli/releases/download/${CREDHUB_VERSION}/credhub-linux-${CREDHUB_VERSION}.tgz && \
tar -xvzf credhub-linux-${CREDHUB_VERSION}.tgz && \
rm -Rf credhub-linux-${CREDHUB_VERSION}.tgz && \
sudo mv credhub /usr/local/bin && \
curl -LO https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl && \
chmod +x kubectl && \
sudo mv kubectl /usr/local/bin && \
curl -L -o kn https://github.com/knative/client/releases/download/knative-v${KNATIVE_VERSION}/kn-linux-amd64 && \
chmod +x kn && \
sudo mv kn /usr/local/bin && \
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/krew-linux_amd64.tar.gz" && \
tar zxvf krew-linux_amd64.tar.gz && \
KREW=./krew-"$(uname | tr '[:upper:]' '[:lower:]')_$(uname -m | sed -e 's/x86_64/amd64/' -e 's/arm.*$/arm/')" && \
"$KREW" install krew && \
echo 'export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"' >> $HOME/.bashrc && \
wget https://github.com/pivotal-cf/om/releases/download/${OM_VERSION}/om-linux-${OM_VERSION} && \
mv om-linux-${OM_VERSION} om && \
chmod +x om && \
sudo mv om /usr/local/bin && \
wget https://github.com/pivotal-cf/pivnet-cli/releases/download/v${PIVNET_VERSION}/pivnet-linux-amd64-${PIVNET_VERSION} && \
mv pivnet-linux-amd64-${PIVNET_VERSION} pivnet && \
chmod +x pivnet && \
sudo mv pivnet /usr/local/bin && \
wget https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
rm -f terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
sudo mv terraform /usr/local/bin && \
curl -Lo ./terraform-docs https://github.com/segmentio/terraform-docs/releases/download/v${TERRAFORM_DOCS_VERSION}/terraform-docs-v${TERRAFORM_DOCS_VERSION}-$(uname | tr '[:upper:]' '[:lower:]')-amd64 && \
chmod +x ./terraform-docs && \
sudo mv terraform-docs /usr/local/bin && \
wget https://github.com/genevieve/leftovers/releases/download/v${LEFTOVERS_VERSION}/leftovers-v${LEFTOVERS_VERSION}-linux-amd64 && \
mv leftovers-v${LEFTOVERS_VERSION}-linux-amd64 leftovers && \
chmod +x leftovers && \
sudo mv leftovers /usr/local/bin && \
curl -LO https://tmc-cli.s3-us-west-2.amazonaws.com/tmc/${TMC_VERSION}/linux/x64/tmc && \
chmod +x tmc && \
sudo mv tmc /usr/local/bin && \
curl -LO "https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz" && \
tar -xvf helm-v${HELM_VERSION}-linux-amd64.tar.gz && \
sudo mv linux-amd64/helm /usr/local/bin && \
curl -Lo ./helmfile https://github.com/roboll/helmfile/releases/download/v${HELMFILE_VERSION}/helmfile_linux_amd64 && \
chmod +x helmfile && \
sudo mv helmfile /usr/local/bin && \
wget -O imgpkg https://github.com/vmware-tanzu/carvel-imgpkg/releases/download/v${IMGPKG_VERSION}/imgpkg-linux-amd64 && \
chmod +x imgpkg && \
sudo mv imgpkg /usr/local/bin && \
wget -O ytt https://github.com/vmware-tanzu/carvel-ytt/releases/download/v${YTT_VERSION}/ytt-linux-amd64 && \
chmod +x ytt && \
sudo mv ytt /usr/local/bin && \
wget -O vendir https://github.com/vmware-tanzu/carvel-vendir/releases/download/v${VENDIR_VERSION}/vendir-linux-amd64 && \
chmod +x vendir && \
sudo mv vendir /usr/local/bin && \
wget -O kapp https://github.com/vmware-tanzu/carvel-kapp/releases/download/v${KAPP_VERSION}/kapp-linux-amd64 && \
chmod +x kapp && \
sudo mv kapp /usr/local/bin && \
wget -O kbld https://github.com/vmware-tanzu/carvel-kbld/releases/download/v${KBLD_VERSION}/kbld-linux-amd64 && \
chmod +x kbld && \
sudo mv kbld /usr/local/bin && \
wget -O kwt https://github.com/vmware-tanzu/carvel-kwt/releases/download/v${KWT_VERSION}/kwt-linux-amd64 && \
chmod +x kwt && \
sudo mv kwt /usr/local/bin && \
curl -LO https://dl.min.io/client/mc/release/linux-amd64/mc && \
chmod +x mc && \
sudo mv mc /usr/local/bin && \
wget -O argocd https://github.com/argoproj/argo-cd/releases/download/v${ARGOCD_VERSION}/argocd-linux-amd64 && \
chmod +x argocd && \
sudo mv argocd /usr/local/bin && \
curl -LO https://github.com/argoproj/argo-workflows/releases/download/v${ARGO_VERSION}/argo-linux-amd64.gz && \
gunzip argo-linux-amd64.gz && \
chmod +x argo-linux-amd64 && \
sudo mv argo-linux-amd64 /usr/local/bin/argo && \
curl -LO https://github.com/tektoncd/cli/releases/download/v${TEKTONCD_VERSION}/tkn_${TEKTONCD_VERSION}_Linux_x86_64.tar.gz && \
tar -xvf tkn_${TEKTONCD_VERSION}_Linux_x86_64.tar.gz && \
chmod +x tkn && \
sudo mv tkn /usr/local/bin && \
curl -LO https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_linux_amd64.tar.gz && \
tar -xvf gh_${GH_VERSION}_linux_amd64.tar.gz && \
chmod +x gh_${GH_VERSION}_linux_amd64/bin/gh && \
sudo mv gh_${GH_VERSION}_linux_amd64/bin/gh /usr/local/bin && \
wget -c https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local && \
sudo ln -s /usr/local/go/bin/go /usr/local/bin/go && \
sudo ln -s /usr/local/go/bin/gofmt /usr/local/bin/gofmt && \
git clone https://github.com/FiloSottile/mkcert && cd mkcert && \
go build -ldflags "-X main.Version=$(git describe --tags)" && \
sudo mv mkcert /usr/local/bin && \
cd .. && \
rm -Rf mkcert && \
curl -LO https://github.com/vmware-tanzu/velero/releases/download/v${VELERO_VERSION}/velero-v${VELERO_VERSION}-linux-amd64.tar.gz && \
tar -xvf velero-v${VELERO_VERSION}-linux-amd64.tar.gz && \
chmod +x velero-v${VELERO_VERSION}-linux-amd64/velero && \
sudo mv velero-v${VELERO_VERSION}-linux-amd64/velero /usr/local/bin && \
curl -LO https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh && \
chmod +x install.sh && \
./install.sh --accept-all-defaults && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \
sudo apt-get update -y && \
sudo apt-get install -y docker-ce docker-ce-cli containerd.io && \
sudo usermod -aG docker vagrant && \
sudo systemctl enable docker.service && \
sudo systemctl enable containerd.service && \
docker run --rm hello-world && \
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v${KIND_VERSION}/kind-linux-amd64 && \
chmod +x ./kind && \
sudo mv ./kind /usr/local/bin && \
curl -LO https://github.com/vmware-labs/marketplace-cli/releases/download/v${MKPCLI_VERSION}/mkpcli-linux-amd64 && \
chmod +x mkpcli-linux-amd64 && \
mv mkpcli-linux-amd64 /usr/local/bin/mkpcli && \
cd .. && rm -Rf downloads /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
apt clean
if [ -e "/home/vagrant/tanzu" ]; then
sudo chmod +x /home/vagrant/tanzu
sudo mv /home/vagrant/tanzu /usr/local/bin
fi
if [ -e "/home/vagrant/tanzu-cli-bundle-linux-amd64.tar" ]; then
tar xvf tanzu-cli-bundle-linux-amd64.tar -C .
tanzu plugin clean
tanzu plugin install --local cli all
rm -Rf cli tanzu-cli-bundle-linux-amd64.tar
fi
chmod +x *.sh
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "peru/ubuntu-20.04-desktop-amd64"
config.vm.box_version = "20210701.01"
config.disksize.size = '50GB'
config.vm.provider "virtualbox" do |v|
v.check_guest_additions = false
v.memory = 8192
v.cpus = 2
end
config.vm.provision "file", source: "dist", destination: "/home/vagrant"
config.vm.provision "file", source: "inventory.sh", destination: "/home/vagrant/inventory.sh"
config.vm.provision "file", source: "fetch-tanzu-cli.sh", destination: "/home/vagrant/fetch-tanzu-cli.sh"
config.vm.provision "file", source: "fetch-and-install-oci-cli.sh", destination: "/home/vagrant/fetch-and-install-oci-cli.sh"
config.vm.provision "shell", inline: $script
end