-
Notifications
You must be signed in to change notification settings - Fork 6
/
Vagrantfile
202 lines (166 loc) · 7.45 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
$script = <<-SCRIPT
# This script should be run in an administrative shell
# It installs software using combination of two package managers: Chocolately and Scoop
# @see https://gist.github.com/mkropat/c1226e0cc2ca941b23a9
function Add-EnvPath {
param(
[Parameter(Mandatory=$true)]
[string] $Path,
[ValidateSet('Machine', 'User', 'Session')]
[string] $Container = 'Session'
)
if ($Container -ne 'Session') {
$containerMapping = @{
Machine = [EnvironmentVariableTarget]::Machine
User = [EnvironmentVariableTarget]::User
}
$containerType = $containerMapping[$Container]
$persistedPaths = [Environment]::GetEnvironmentVariable('Path', $containerType) -split ';'
if ($persistedPaths -notcontains $Path) {
$persistedPaths = $persistedPaths + $Path | where { $_ }
[Environment]::SetEnvironmentVariable('Path', $persistedPaths -join ';', $containerType)
}
}
$envPaths = $env:Path -split ';'
if ($envPaths -notcontains $Path) {
$envPaths = $envPaths + $Path | where { $_ }
$env:Path = $envPaths -join ';'
}
}
function Remove-EnvPath {
param(
[Parameter(Mandatory=$true)]
[string] $Path,
[ValidateSet('Machine', 'User', 'Session')]
[string] $Container = 'Session'
)
if ($Container -ne 'Session') {
$containerMapping = @{
Machine = [EnvironmentVariableTarget]::Machine
User = [EnvironmentVariableTarget]::User
}
$containerType = $containerMapping[$Container]
$persistedPaths = [Environment]::GetEnvironmentVariable('Path', $containerType) -split ';'
if ($persistedPaths -contains $Path) {
$persistedPaths = $persistedPaths | where { $_ -and $_ -ne $Path }
[Environment]::SetEnvironmentVariable('Path', $persistedPaths -join ';', $containerType)
}
}
$envPaths = $env:Path -split ';'
if ($envPaths -contains $Path) {
$envPaths = $envPaths | where { $_ -and $_ -ne $Path }
$env:Path = $envPaths -join ';'
}
}
function Get-EnvPath {
param(
[Parameter(Mandatory=$true)]
[ValidateSet('Machine', 'User')]
[string] $Container
)
$containerMapping = @{
Machine = [EnvironmentVariableTarget]::Machine
User = [EnvironmentVariableTarget]::User
}
$containerType = $containerMapping[$Container]
[Environment]::GetEnvironmentVariable('Path', $containerType) -split ';' |
where { $_ }
}
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')
#####################
# BILL OF MATERIALS
#####################
scoop install git
scoop bucket add extras
# 7Zip
scoop install 7zip
# Dev Tools
choco install -y docker-desktop
choco install podman-cli -y --pre
scoop install aria2
choco install -y argocd-cli
choco install -y bosh-cli
scoop install vscode
scoop install azure-cli
choco install -y aws-iam-authenticator
scoop install aws
choco install -y cloudfoundry-cli
scoop install gcloud
choco install -y gnupg
choco install -y golang
choco install -y gzip
scoop install graphviz
choco install -y libressl
choco install -y minio-client
choco install -y openssl
scoop install terraform
choco install -y terraform-docs
scoop install tflint
choco install -y httpie -source python
choco install -y keybase
choco install -y kind
scoop install kubectl
scoop install k9s
scoop install helm
scoop install helmfile
choco install -y mkcert
scoop install octant
scoop tar install
choco install -y tektoncd-cli
choco install -y vendir
choco install -y ytt
choco install -y kapp
choco install -y kbld
choco install -y imgpkg
scoop bucket add tilt-dev https://github.com/tilt-dev/scoop-bucket
scoop install tilt
choco install -y velero
Set-Variable TARGET_DIR "C:/Users/vagrant"
Set-Variable LOCAL_BIN_DIR $TARGET_DIR/.cli/bin
md $LOCAL_BIN_DIR -ea 0
cd $LOCAL_BIN_DIR
Invoke-WebRequest https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.ps1 -OutFile install.ps1
iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.ps1'))
install.ps1 -AcceptAllDefaults
Remove-Item install.ps1
Set-Variable PIVNET_VERSION 3.0.1
(New-Object System.Net.WebClient).DownloadFile("https://github.com/pivotal-cf/pivnet-cli/releases/download/v$PIVNET_VERSION/pivnet-windows-amd64-$PIVNET_VERSION", "$LOCAL_BIN_DIR/pivnet-windows-amd64-$PIVNET_VERSION.exe")
Rename-Item -Path "$LOCAL_BIN_DIR/pivnet-windows-amd64-$PIVNET_VERSION.exe" -NewName "$LOCAL_BIN_DIR/pivnet.exe"
Set-Variable OM_VERSION 7.4.1
(New-Object System.Net.WebClient).DownloadFile("https://github.com/pivotal-cf/om/releases/download/$OM_VERSION/om-windows-$OM_VERSION.exe", "$LOCAL_BIN_DIR/om-windows-$OM_VERSION.exe")
Rename-Item -Path "$LOCAL_BIN_DIR/om-windows-$OM_VERSION.exe" -NewName "$LOCAL_BIN_DIR/om.exe"
Set-Variable ARGOCD_VERSION 2.1.7
(New-Object System.Net.WebClient).DownloadFile("https://github.com/argoproj/argo-cd/releases/download/v$ARGOCD_VERSION/argocd-windows-amd64.exe", "$LOCAL_BIN_DIR/argocd-windows-amd64.exe")
Rename-Item -Path "$LOCAL_BIN_DIR/argocd-windows-amd64.exe" -NewName "$LOCAL_BIN_DIR/argocd.exe"
Set-Variable ARGO_VERSION 3.2.4
(New-Object System.Net.WebClient).DownloadFile("https://github.com/argoproj/argo-workflows/releases/download/v$ARGO_VERSION/argo-windows-amd64.gz", "$LOCAL_BIN_DIR/argo-windows-amd64.gz")
gunzip $LOCAL_BIN_DIR/argo-windows-amd64.gz
Rename-Item -Path "$LOCAL_BIN_DIR/argo-windows-amd64.exe" -NewName "$LOCAL_BIN_DIR/argo.exe"
Remove-Item $LOCAL_BIN_DIR/argo-windows-amd64.gz
Set-Variable KREW_VERSION 0.4.2
(New-Object System.Net.WebClient).DownloadFile("https://github.com/kubernetes-sigs/krew/releases/download/v$KREW_VERSION/krew.exe", "$LOCAL_BIN_DIR/krew.exe")
(New-Object System.Net.WebClient).DownloadFile("https://github.com/kubernetes-sigs/krew/releases/download/v$KREW_VERSION/krew.yaml", "$LOCAL_BIN_DIR/krew.yaml")
Set-Variable TMC_VERSION 0.4.0-089ff971
(New-Object System.Net.WebClient).DownloadFile("https://tmc-cli.s3-us-west-2.amazonaws.com/tmc/$TMC_VERSION/windows/x64/tmc.exe", "$LOCAL_BIN_DIR/tmc.exe")
Set-Variable KNATIVE_VERSION 1.0.0
(New-Object System.Net.WebClient).DownloadFile("https://github.com/knative/client/releases/download/knative-v$KNATIVE_VERSION/kn-windows-amd64.exe", "$LOCAL_BIN_DIR/kn.exe")
Set-Variable MKPCLI_VERSION 0.5.3
(New-Object System.Net.WebClient).DownloadFile("https://github.com/vmware-labs/marketplace-cli/releases/download/v$MKPCLI_VERSION/mkpcli-windows-amd64", "$LOCAL_BIN_DIR/mkpcli.exe") && \
Add-EnvPath -Path "$LOCAL_BIN_DIR" -Container "Machine"
Move-Item -Path $TARGET_DIR/tanzu.exe -Destination $LOCAL_BIN_DIR/tanzu.exe
krew install --manifest=$LOCAL_BIN_DIR/krew.yaml
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "StefanScherer/windows_10"
config.disksize.size = '60GB'
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: "/Users/vagrant"
config.vm.provision "file", source: "inventory.ps1", destination: "/home/vagrant/inventory.ps1"
config.vm.provision "shell", inline: $script
end