Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add agent node changes to support windows gradle check #228

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions lib/compute/agent-node-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,26 @@ export class AgentNodeConfig {
key: 'JENKINS_HOME_PATH',
value: config.remoteFs,
},
{
key: 'JAVA8_HOME',
value: '/usr/lib/jvm/temurin-8-jdk-amd64',
},
{
key: 'JAVA11_HOME',
value: '/usr/lib/jvm/temurin-11-jdk-amd64',
},
{
key: 'JAVA14_HOME',
value: '/usr/lib/jvm/adoptopenjdk-14-amd64',
},
{
key: 'JAVA17_HOME',
value: '/usr/lib/jvm/temurin-17-jdk-amd64',
},
{
key: 'JAVA19_HOME',
value: '/usr/lib/jvm/temurin-19-jdk-amd64',
},
],
},
},
Expand Down
8 changes: 4 additions & 4 deletions lib/compute/agent-nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class AgentNodes {
maxTotalUses: 1,
minimumNumberOfSpareInstances: 1,
numExecutors: 1,
amiId: 'ami-0e2c243aa3bdb082c',
amiId: 'ami-048e8e134e5e71966',
initScript: 'sudo apt-mark hold docker docker.io openssh-server gh && docker ps &&'
+ ' sudo apt-get update -y && (sudo killall -9 apt-get apt 2>&1 || echo) && sudo apt-get upgrade -y',
remoteFs: '/var/jenkins',
Expand All @@ -123,7 +123,7 @@ export class AgentNodes {
maxTotalUses: -1,
minimumNumberOfSpareInstances: 1,
numExecutors: 1,
amiId: 'ami-0e2c243aa3bdb082c',
amiId: 'ami-048e8e134e5e71966',
initScript: 'sudo apt-mark hold docker docker.io openssh-server gh && docker ps &&'
+ ' sudo apt-get update -y && (sudo killall -9 apt-get apt 2>&1 || echo) && sudo apt-get upgrade -y',
remoteFs: '/var/jenkins',
Expand All @@ -148,7 +148,7 @@ export class AgentNodes {
maxTotalUses: -1,
minimumNumberOfSpareInstances: 2,
numExecutors: 1,
amiId: 'ami-0720b70e6cb2e8012',
amiId: 'ami-0dc81a572a6f17f5b',
initScript: 'echo',
remoteFs: 'C:/Users/Administrator/jenkins',
};
Expand All @@ -160,7 +160,7 @@ export class AgentNodes {
maxTotalUses: 1,
minimumNumberOfSpareInstances: 1,
numExecutors: 1,
amiId: 'ami-0720b70e6cb2e8012',
amiId: 'ami-0dc81a572a6f17f5b',
initScript: 'echo',
remoteFs: 'C:/Users/Administrator/jenkins',
};
Expand Down
6 changes: 3 additions & 3 deletions packer/scripts/ubuntu2004/ubuntu2004-agent-setups.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo
&& sudo apt-get update \
&& sudo apt-get install gh -y

sudo apt-mark hold docker docker.io openssh-server
sudo apt-get clean -y

sudo mkdir -p /var/jenkins && sudo chown -R ubuntu:ubuntu /var/jenkins

# Pre-install multi-jdk
Expand All @@ -49,3 +46,6 @@ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/adoptope
sudo update-alternatives --set "java" "/usr/lib/jvm/temurin-8-jdk-amd64/bin/java"
sudo update-alternatives --set "javac" "/usr/lib/jvm/temurin-8-jdk-amd64/bin/javac"
java -version

sudo apt-mark hold docker docker.io openssh-server temurin-8-jdk temurin-11-jdk temurin-17-jdk temurin-19-jdk
sudo apt-get clean -y
23 changes: 20 additions & 3 deletions packer/scripts/windows/scoop-install-commons.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,25 @@ $zlibRegFilePath = "$zlibHome\\register.reg"
$zlibRegFilePath
regedit /s $zlibRegFilePath

# Install jdk8
scoop install temurin8-jdk
# Install jdk
$jdkVersionList = "temurin8-jdk JAVA8_HOME", "temurin11-jdk JAVA11_HOME", "temurin17-jdk JAVA17_HOME", "temurin19-jdk JAVA19_HOME", "openjdk14 JAVA14_HOME"
Foreach ($jdkVersion in $jdkVersionList)
{
$jdkVersion
$jdkArray = $jdkVersion.Split(" ")
$jdkArray[0]
$jdkArray[1]
scoop install $jdkArray[0]
$JAVA_HOME_TEMP = [System.Environment]::GetEnvironmentVariable("JAVA_HOME", [System.EnvironmentVariableTarget]::User).replace("\", "/")
$JAVA_HOME_TEMP
[System.Environment]::SetEnvironmentVariable($jdkArray[1], "$JAVA_HOME_TEMP", [System.EnvironmentVariableTarget]::User)
java -version
}
# Need to reset to jdk8 run Jenkins Agent
scoop reset temurin8-jdk
$JAVA_HOME_TEMP = [System.Environment]::GetEnvironmentVariable("JAVA_HOME", [System.EnvironmentVariableTarget]::User).replace("\", "/")
$JAVA_HOME_TEMP
[System.Environment]::SetEnvironmentVariable('JAVA_HOME', "$JAVA_HOME_TEMP", [System.EnvironmentVariableTarget]::User)
java -version

# Install python37
Expand Down Expand Up @@ -112,7 +129,7 @@ Foreach ($nodeVersion in $nodeVersionList)
volta install "node@$nodeVersion"
node -v
}
volta install yarn
volta install yarn@^1.21.1
yarn --version
$userenv2 = [System.Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::User)
$nodePathFixed = "C:\\Users\\Administrator\\scoop\\persist\\volta\\appdata\\bin"
Expand Down