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 JENKINS_HOME_PATH as default JENKINS_HOME always returns /var/jenkins_home and update jdk14 #215

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
36 changes: 36 additions & 0 deletions lib/compute/agent-node-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,18 @@ export class AgentNodeConfig {
],
tenancy: 'Default',
type: config.instanceType,
nodeProperties: [
{
envVars: {
env: [
{
key: 'JENKINS_HOME_PATH',
value: config.remoteFs,
},
],
},
},
],
useEphemeralDevices: false,
};
}
Expand Down Expand Up @@ -243,6 +255,18 @@ export class AgentNodeConfig {
],
tenancy: 'Host',
type: config.instanceType,
nodeProperties: [
{
envVars: {
env: [
{
key: 'JENKINS_HOME_PATH',
value: config.remoteFs,
},
],
},
},
],
useEphemeralDevices: false,
};
}
Expand Down Expand Up @@ -293,6 +317,18 @@ export class AgentNodeConfig {
],
tenancy: 'Default',
type: config.instanceType,
nodeProperties: [
{
envVars: {
env: [
{
key: 'JENKINS_HOME_PATH',
value: config.remoteFs,
},
],
},
},
],
useEphemeralDevices: false,
};
}
Expand Down
12 changes: 10 additions & 2 deletions resources/baseJenkins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,16 @@ tool:
properties:
- installSource:
installers:
- zip:
url: "https://ci.opensearch.org/ci/dbc/tools/OpenJDK14U-jdk_x64_linux_hotspot_14.0.2_12.zip"
- command:
command: "JENKINS_HOME_LINUX=\"/var/jenkins\"\nJENKINS_HOME_WINDOWS=\"\
C:/Users/Administrator/jenkins\"\n \n\nif uname -s | grep -i NT; then\n\
\ echo windows agent\n JENKINS_JDK14_PATH=$JENKINS_HOME_WINDOWS/tools/hudson.model.JDK/openjdk-14\n\
\ JDK14_ZIP=\"OpenJDK14U-jdk_x64_windows_hotspot_14.0.2_12.zip\"\
\n \nelse\n echo linux agent\n JENKINS_JDK14_PATH=$JENKINS_HOME_LINUX/tools/hudson.model.JDK/openjdk-14\n\
\ JDK14_ZIP=\"OpenJDK14U-jdk_x64_linux_hotspot_14.0.2_12.zip\"\
\n \nfi\n\n\nmkdir -p $JENKINS_JDK14_PATH\ncd $JENKINS_JDK14_PATH\n\
pwd\nrm -rf ./*\ncurl -sSL https://ci.opensearch.org/ci/dbc/tools/$JDK14_ZIP\
peterzhuamazon marked this conversation as resolved.
Show resolved Hide resolved
\ -o jdk14.zip\nunzip -q jdk14.zip\nrm jdk14.zip\n\n"
gaiksaya marked this conversation as resolved.
Show resolved Hide resolved
- name: "openjdk-17"
properties:
- installSource:
Expand Down
40 changes: 37 additions & 3 deletions test/data/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,43 @@ tool:
properties:
- installSource:
installers:
- zip:
url: >-
https://ci.opensearch.org/ci/dbc/tools/OpenJDK14U-jdk_x64_linux_hotspot_14.0.2_12.zip
- command:
command: >+
JENKINS_HOME_LINUX="/var/jenkins"

JENKINS_HOME_WINDOWS="C:/Users/Administrator/jenkins"


if uname -s | grep -i NT; then
echo windows agent
JENKINS_JDK14_PATH=$JENKINS_HOME_WINDOWS/tools/hudson.model.JDK/openjdk-14
JDK14_ZIP="OpenJDK14U-jdk_x64_windows_hotspot_14.0.2_12.zip"

else
echo linux agent
JENKINS_JDK14_PATH=$JENKINS_HOME_LINUX/tools/hudson.model.JDK/openjdk-14
JDK14_ZIP="OpenJDK14U-jdk_x64_linux_hotspot_14.0.2_12.zip"

fi



mkdir -p $JENKINS_JDK14_PATH

cd $JENKINS_JDK14_PATH

pwd

rm -rf ./*

curl -sSL
https://ci.opensearch.org/ci/dbc/tools/$JDK14_ZIP -o
jdk14.zip

unzip -q jdk14.zip

rm jdk14.zip

- name: openjdk-17
properties:
- installSource:
Expand Down