Forked from PlagueHO/ Create-Jenkins-Slave-On-Windows-Server-Core.ps1
Last active
October 7, 2016 22:02
-
-
Save zionyx/635da27746f007e1fdbbfeddd8e8ca92 to your computer and use it in GitHub Desktop.
Create a Jenkins Slave on a Windows Server 2012 R2 Core install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configure the settings to use to setup this Jenkins Slave | |
$IPAddress = '192.168.1.96' | |
$SubnetPrefixLength = 24 | |
$DNSServers = @('192.168.1.1') | |
$DefaultGateway = '192.168.1.1' | |
$JenkinsSlaveFolder = 'c:\jenkins' | |
# Install .NET Framework 3.5 | |
Install-WindowsFeature -Name NET-Framework-Core | |
# Install Chocolatey | |
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/installabsolutelatest.ps1')) | |
# Install JDK 8 | |
choco install jdk8 -y | |
# Set a static IP Address - optional | |
New-NetIPAddress ` | |
-IPAddress $IPAddress ` | |
-InterfaceAlias Ethernet ` | |
-DefaultGateway $DefaultGateway ` | |
-AddressFamily IPv4 ` | |
-PrefixLength $SubnetPrefixLength | |
Set-DnsClientServerAddress ` | |
-InterfaceAlias Ethernet ` | |
-Addresses $DNSServers | |
# Create the Jenkins Slave folder | |
New-Item ` | |
-Path $JenkinsSlaveFolder ` | |
-ItemType Directory | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment