2019-12-16 19:56:02 +01:00
|
|
|
# Copyright 2019 Google LLC
|
|
|
|
|
|
|
|
# Licensed under the the Apache License v2.0 with LLVM Exceptions (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
|
|
|
|
# https://llvm.org/LICENSE.txt
|
|
|
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2020-01-22 17:02:05 +01:00
|
|
|
# 1st stage of the installation process.
|
|
|
|
# This script only needs to be run once per machine.
|
|
|
|
|
2019-12-16 19:56:02 +01:00
|
|
|
Write-Host "Initializing local SSD..."
|
2020-03-25 16:12:31 +01:00
|
|
|
New-Variable -Name diskid -Value (Get-Disk -FriendlyName "Google EphemeralDisk").Number
|
|
|
|
#New-Variable -Name diskid -Value (Get-Disk -FriendlyName "NVMe nvme_card").Number
|
2020-03-25 16:00:57 +01:00
|
|
|
|
2019-12-16 19:56:02 +01:00
|
|
|
# TODO: check if machine has an SSD
|
2020-01-22 17:02:05 +01:00
|
|
|
# TODO: only do this, if SSD is not yet partioned and formatted
|
2019-12-16 19:56:02 +01:00
|
|
|
Initialize-Disk -Number $diskid
|
|
|
|
New-Partition -DiskNumber $diskid -UseMaximumSize -AssignDriveLetter
|
|
|
|
Format-Volume -DriveLetter D
|
|
|
|
|
|
|
|
Write-Host "install chocolately as package manager..."
|
|
|
|
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
|
|
|
|
choco feature disable --name showDownloadProgress
|
2020-01-22 17:02:05 +01:00
|
|
|
choco install -y git
|
|
|
|
|
2020-02-03 15:25:08 +01:00
|
|
|
# move docker folder to SSD to get better IO performance
|
|
|
|
New-Item -Path "D:\" -Name "Docker" -ItemType "directory"
|
|
|
|
cmd /C "mklink /j C:\ProgramData\Docker D:\docker"
|
|
|
|
|
2020-01-22 17:02:05 +01:00
|
|
|
# install Docker
|
|
|
|
Install-PackageProvider -Name NuGet -Force
|
|
|
|
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
|
|
|
|
Install-Package -Name docker -ProviderName DockerMsftProvider -Force
|
2020-03-25 16:12:31 +01:00
|
|
|
Set-Service -Name docker -StartupType AutomaticDelayedStart
|
2020-01-22 17:02:05 +01:00
|
|
|
|
|
|
|
# install gcloud and authenticate access to gcr.io registry
|
|
|
|
# TODO: find a better way to install the Google Cloud SDK, avoid ingoring the checksum
|
|
|
|
choco install -y gcloudsdk --ignore-checksums
|
2019-12-16 19:56:02 +01:00
|
|
|
|
2020-01-22 17:02:05 +01:00
|
|
|
# Reboot
|
|
|
|
Restart-Computer -Force
|