-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwindows_instance.yaml
57 lines (54 loc) · 2.65 KB
/
windows_instance.yaml
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
ImageId: ami-0d7d80db021ba0d11
MinCount: 1
MaxCount: 1
KeyName: ssh_pllarroy_key
#InstanceType: p3.2xlarge
InstanceType: c5.9xlarge
SecurityGroupIds:
- sg-2902ce56
- sg-cac294b6
- sg-0540d02a69775cd54
BlockDeviceMappings:
- DeviceName: /dev/sda1
Ebs: {DeleteOnTermination: true, VolumeSize: 128, VolumeType: io1, Iops: 6000}
#IamInstanceProfile:
# Name: jenkins_slave_role
UserData: |
<powershell>
$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest
function Check-Call {
param (
[scriptblock]$ScriptBlock
)
Write-Host "Executing $ScriptBlock"
& @ScriptBlock
if (($lastexitcode -ne 0)) {
Write-Error "Execution failed with $lastexitcode"
exit $lastexitcode
}
}
cd C:\Users\Administrator
$progressPreference = 'silentlyContinue'
Invoke-WebRequest -Uri https://cygwin.com/setup-x86_64.exe -OutFile setup-x86_64.exe
.\setup-x86_64.exe --site http://cygwin.mirror.constant.com --quiet-mode --root "C:\cygwin64" --local-package-dir "C:\Users\Administrator" --verbose --prune-install --packages openssh,git,rsync,vim,python3
Invoke-WebRequest -Uri "https://download.mozilla.org/?product=firefox-latest-ssl&os=win64&lang=en-US" -OutFile ffox.exe
.\ffox.exe /n /s
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v HideFileExt /t REG_DWORD /d 0 /f
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
#Install-Module -Force OpenSSHUtils -Scope AllUsers
Set-Service -Name ssh-agent -StartupType 'Automatic'
Set-Service -Name sshd -StartupType 'Automatic'
Start-Service ssh-agent
Start-Service sshd
Invoke-WebRequest -Uri https://raw.githubusercontent.com/aiengines/ci/master/ami_generation/windows/setup.ps1 -OutFile setup.ps1
Invoke-WebRequest -Uri https://raw.githubusercontent.com/aiengines/ci/master/ami_generation/windows/windows_deps_headless_installer.py -OutFile windows_deps_headless_installer.py
Invoke-WebRequest -Uri https://raw.githubusercontent.com/aiengines/ci/master/ami_generation/windows/requirements.txt -OutFile requirements.txt
Invoke-WebRequest -Uri https://raw.githubusercontent.com/aiengines/ci/master/ami_generation/windows/jenkins_slave.ps1 -OutFile jenkins_slave.ps1
Invoke-WebRequest -Uri https://raw.githubusercontent.com/aiengines/ci/master/ami_generation/autoconnect.py -OutFile autoconnect.py
Check-Call { .\setup.ps1 }
New-Item -ItemType file userdata_finished
Stop-Computer
</powershell>