-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update builtin images, add Ubuntu 20.04, Windows Server 2019 (#260)
- Loading branch information
Showing
17 changed files
with
284 additions
and
182 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | ||
|
||
choco install -y adoptopenjdk11 | ||
|
||
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") | ||
|
||
java -version | ||
|
||
# Install Maven | ||
|
||
choco install -y maven | ||
|
||
$env:M2_HOME = [System.Environment]::GetEnvironmentVariable("M2_HOME","Machine") | ||
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") | ||
|
||
mvn --version | ||
|
||
# Install Git | ||
|
||
choco install -y git | ||
|
||
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") | ||
|
||
#Disable git credential manager, get more details in https://support.cloudbees.com/hc/en-us/articles/221046888-Build-Hang-or-Fail-with-Git-for-Windows | ||
git config --system --unset credential.helper | ||
|
||
git --version | ||
|
||
# Setup inbound agent | ||
|
||
$jenkinsserverurl = $args[0] | ||
$vmname = $args[1] | ||
$secret = $args[2] | ||
|
||
# Downloading jenkins agent jar | ||
Write-Output "Downloading jenkins agent jar " | ||
$slaveSource = $jenkinsserverurl + "jnlpJars/agent.jar" | ||
$destSource = "C:\agent.jar" | ||
$wc = New-Object System.Net.WebClient | ||
$wc.DownloadFile($slaveSource, $destSource) | ||
|
||
# execute agent | ||
Write-Output "Executing agent process " | ||
$java="java" | ||
$jar="-jar" | ||
$jnlpUrl="-jnlpUrl" | ||
$secretFlag="-secret" | ||
$serverURL=$jenkinsserverurl+"computer/" + $vmname + '/jenkins-agent.jnlp' | ||
|
||
# TODO look at porting the run as service part of the old script from https://raw.githubusercontent.com/Azure/jenkins/master/agents_scripts/Jenkins-Windows-Init-Script-Jnlp.ps1 | ||
while ($true) { | ||
try { | ||
# Launch | ||
& $java -jar $destSource $secretFlag $secret $jnlpUrl $serverURL -noReconnect | ||
} | ||
catch [System.Exception] { | ||
Write-Output $_.Exception.ToString() | ||
} | ||
Start-Sleep 10 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | ||
|
||
choco install -y adoptopenjdk11 | ||
|
||
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") | ||
|
||
java -version | ||
|
||
# Install Maven | ||
|
||
choco install -y maven | ||
|
||
$env:M2_HOME = [System.Environment]::GetEnvironmentVariable("M2_HOME","Machine") | ||
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") | ||
|
||
mvn --version | ||
|
||
# Install Git | ||
|
||
choco install -y git | ||
|
||
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") | ||
|
||
#Disable git credential manager, get more details in https://support.cloudbees.com/hc/en-us/articles/221046888-Build-Hang-or-Fail-with-Git-for-Windows | ||
git config --system --unset credential.helper | ||
|
||
git --version |
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
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
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
47 changes: 18 additions & 29 deletions
47
src/main/resources/com/microsoft/azure/vmagent/AzureVMAgent/configure-entries.jelly
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,25 @@ | ||
<?jelly escape-by-default='true'?> | ||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"> | ||
|
||
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form"> | ||
<f:section title="${%Azure_Agent_Configuration}"> | ||
<f:block> | ||
<b>${%FQDN}</b>: ${instance.getPublicDNSName()} | ||
</f:block> | ||
<f:block> | ||
<div> | ||
<p><strong>${%FQDN}</strong>: ${instance.getPublicDNSName()}</p> | ||
<p><strong>${%Public_IP}</strong>: </p> | ||
<j:choose> | ||
<j:when test="${!empty(instance.getPublicIP())}"> | ||
${instance.getPublicIP()} | ||
</j:when> | ||
<j:when test="${empty(instance.getPublicIP())}"> | ||
<input type="hidden" value="${instance.getNodeName()}" name="vmAgentName" /> | ||
|
||
<div style="float:left"> | ||
<b>${%Public_IP}</b>: | ||
<input type="button" value="${%Attach_Public_IP}" class="yui-button validate-button" onclick="validateButton('${descriptor.descriptorFullUrl}/attachPublicIP','vmAgentName',this)" /> | ||
</div> | ||
<div style="display:none;float:left"> | ||
<img src="${imagesURL}/spinner.gif" /> ${%Attaching_Public_IP} | ||
</div> | ||
<j:choose> | ||
<j:when test="${!empty(instance.getPublicIP())}"> | ||
<div style="float:left">${instance.getPublicIP()}</div> | ||
</j:when> | ||
<j:when test="${empty(instance.getPublicIP())}"> | ||
<input type="hidden" value="${instance.getNodeName()}" name="vmAgentName" /> | ||
|
||
<div style="float:left"> | ||
<input type="button" value="${%Attach_Public_IP}" class="yui-button validate-button" onclick="validateButton('${descriptor.descriptorFullUrl}/attachPublicIP','vmAgentName',this)" /> | ||
</div> | ||
<div style="display:none;float:left"> | ||
<img src="${imagesURL}/spinner.gif" /> ${%Attaching_Public_IP} | ||
</div> | ||
<div style="float:left"><!-- this is where the error message goes --></div> | ||
</j:when> | ||
</j:choose> | ||
</div> | ||
</f:block> | ||
<f:block> | ||
<b>${%Private_IP}</b>: ${instance.getPrivateIP()} | ||
</f:block> | ||
<div><!-- this is where the error message goes --></div> | ||
</j:when> | ||
</j:choose> | ||
<p><strong>${%Private_IP}</strong>: ${instance.getPrivateIP()}</p> | ||
</f:section> | ||
|
||
</j:jelly> |
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
Oops, something went wrong.