Skip to content

Commit 0861acc

Browse files
committed
perform config terminology migrations
1 parent aac6882 commit 0861acc

9 files changed

+54
-54
lines changed

jenkins_bootstrap.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,5 @@ fi
128128

129129
#configure jenkins agent credentials
130130
#jenkins_console --script "${SCRIPT_LIBRARY_PATH}/credentials-jenkins-agent.groovy"
131-
#disable agent -> master security
132-
#jenkins_console --script "${SCRIPT_LIBRARY_PATH}/security-disable-agent-master.groovy"
131+
#disable agent -> controller security
132+
#jenkins_console --script "${SCRIPT_LIBRARY_PATH}/security-disable-agent-controller.groovy"

scripts/configure-docker-cloud.groovy

+4-4
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ JSONArray clouds_docker = [
8282
launcher_credentials_id: "jenkins-docker-cloud-credentials",
8383
launcher_jvm_options: "",
8484
launcher_java_path: "/home/jenkins/java/openjdk8/bin/java",
85-
launcher_prefix_start_slave_cmd: "",
86-
launcher_suffix_start_slave_cmd: "",
85+
launcher_prefix_start_agent_cmd: "",
86+
launcher_suffix_start_agent_cmd: "",
8787
launcher_connection_timeout_seconds: 0,
8888
launcher_max_num_retries: 0,
8989
launcher_retry_wait_time: 0
@@ -129,8 +129,8 @@ def newDockerTemplate(JSONObject obj) {
129129
obj.optString('launcher_credentials_id'),
130130
obj.optString('launcher_jvm_options'),
131131
obj.optString('launcher_java_path'),
132-
obj.optString('launcher_prefix_start_slave_cmd'),
133-
obj.optString('launcher_suffix_start_slave_cmd'),
132+
obj.optString('launcher_prefix_start_agent_cmd'),
133+
obj.optString('launcher_suffix_start_agent_cmd'),
134134
obj.optInt('launcher_connection_timeout_seconds'),
135135
obj.optInt('launcher_max_num_retries'),
136136
obj.optInt('launcher_retry_wait_time')

scripts/configure-jenkins-settings.groovy

+32-32
Original file line numberDiff line numberDiff line change
@@ -23,39 +23,39 @@
2323
- System message
2424
- Quiet Period
2525
- SCM checkout retry count
26-
- Number of master executors
27-
- Master labels
28-
- Master usage (e.g. exclusive or any job runs on master)
29-
- TCP port for JNLP slave agents
26+
- Number of controller executors
27+
- Controller labels
28+
- Controller usage (e.g. exclusive requiring built-in label or any job could run by default)
29+
- TCP port for JNLP build agents
3030
*/
3131

3232
import jenkins.model.Jenkins
3333
import jenkins.model.JenkinsLocationConfiguration
3434
import net.sf.json.JSONObject
3535

36-
if(!binding.hasVariable('master_settings')) {
37-
master_settings = [:]
36+
if(!binding.hasVariable('controller_settings')) {
37+
controller_settings = [:]
3838
}
39-
if(!(master_settings instanceof Map)) {
40-
throw new Exception('master_settings must be a Map.')
39+
if(!(controller_settings instanceof Map)) {
40+
throw new Exception('controller_settings must be a Map.')
4141
}
4242

43-
master_settings = master_settings as JSONObject
43+
controller_settings = controller_settings as JSONObject
4444

4545
def requiredDefaultValues(def value, List values, def default_value) {
4646
(value in values)? value : default_value
4747
}
4848

4949
//settings with sane defaults
50-
String frontend_url = master_settings.optString('frontend_url', 'http://localhost:8080/')
51-
String admin_email = master_settings.optString('admin_email')
52-
String system_message = master_settings.optString('system_message')
53-
int quiet_period = master_settings.optInt('quiet_period', 5)
54-
int scm_checkout_retry_count = master_settings.optInt('scm_checkout_retry_count', 0)
55-
int master_executors = master_settings.optInt('master_executors', 2)
56-
String master_labels = master_settings.optString('master_labels')
57-
String master_usage = requiredDefaultValues(master_settings.optString('master_usage').toUpperCase(), ['NORMAL', 'EXCLUSIVE'], 'EXCLUSIVE')
58-
int jnlp_slave_port = master_settings.optInt('jnlp_slave_port', -1)
50+
String frontend_url = controller_settings.optString('frontend_url', 'http://localhost:8080/')
51+
String admin_email = controller_settings.optString('admin_email')
52+
String system_message = controller_settings.optString('system_message')
53+
int quiet_period = controller_settings.optInt('quiet_period', 5)
54+
int scm_checkout_retry_count = controller_settings.optInt('scm_checkout_retry_count', 0)
55+
int controller_executors = controller_settings.optInt('controller_executors', 2)
56+
String controller_labels = controller_settings.optString('controller_labels')
57+
String controller_usage = requiredDefaultValues(controller_settings.optString('controller_usage').toUpperCase(), ['NORMAL', 'EXCLUSIVE'], 'EXCLUSIVE')
58+
int jnlp_agent_port = controller_settings.optInt('jnlp_agent_port', -1)
5959

6060
Jenkins j = Jenkins.instance
6161
JenkinsLocationConfiguration location = j.getExtensionList('jenkins.model.JenkinsLocationConfiguration')[0]
@@ -86,29 +86,29 @@ if(j.scmCheckoutRetryCount != scm_checkout_retry_count) {
8686
j.scmCheckoutRetryCount = scm_checkout_retry_count
8787
save = true
8888
}
89-
if(j.numExecutors != master_executors) {
90-
println "Setting master num executors to: ${master_executors}"
91-
j.numExecutors = master_executors
89+
if(j.numExecutors != controller_executors) {
90+
println "Setting controller num executors to: ${controller_executors}"
91+
j.numExecutors = controller_executors
9292
save = true
9393
}
94-
if(j.labelString != master_labels) {
95-
println "Setting master labels to: ${master_labels}"
96-
j.setLabelString(master_labels)
94+
if(j.labelString != controller_labels) {
95+
println "Setting controller labels to: ${controller_labels}"
96+
j.setLabelString(controller_labels)
9797
save = true
9898
}
99-
if(j.mode.toString() != master_usage) {
100-
println "Setting master usage to: ${master_usage}"
101-
j.mode = Node.Mode."${master_usage}"
99+
if(j.mode.toString() != controller_usage) {
100+
println "Setting controller usage to: ${controller_usage}"
101+
j.mode = Node.Mode."${controller_usage}"
102102
save = true
103103
}
104-
if(j.slaveAgentPort != jnlp_slave_port) {
105-
if(jnlp_slave_port <= 65535 && jnlp_slave_port >= -1) {
106-
println "Set JNLP Slave port: ${jnlp_slave_port}"
107-
j.slaveAgentPort = jnlp_slave_port
104+
if(j.slaveAgentPort != jnlp_agent_port) {
105+
if(jnlp_agent_port <= 65535 && jnlp_agent_port >= -1) {
106+
println "Set JNLP Agent port: ${jnlp_agent_port}"
107+
j.slaveAgentPort = jnlp_agent_port
108108
save = true
109109
}
110110
else {
111-
println "WARNING: JNLP port ${jnlp_slave_port} outside of TCP port range. Must be within -1 <-> 65535. Nothing changed."
111+
println "WARNING: JNLP port ${jnlp_agent_port} outside of TCP port range. Must be within -1 <-> 65535. Nothing changed."
112112
}
113113
}
114114
//save configuration to disk

scripts/configure-permanent-agents.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ permanent_agents = [
6666
plugin without requiring that it be installed if an admin does not need to
6767
configure SSH agents.
6868
69-
This script will succeed both with and without the SSH slaves plugin
69+
This script will succeed both with and without the SSH Build Agents plugin
7070
installed.
7171
*/
7272
Class loadClass(String clazz) {

scripts/configure-pipeline-global-shared-libraries.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ boolean isLibrariesEqual(List lib1, List lib2) {
5959
/* Example configuration
6060
pipeline_shared_libraries = [
6161
'Global Library Name': [
62-
'defaultVersion': 'master-fu',
62+
'defaultVersion': 'main',
6363
'implicit': true,
6464
'allowVersionOverride': false,
6565
'includeInChangesets': false,

scripts/configure-yadocker-cloud.groovy

+11-11
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ clouds_yadocker = [
127127
//STOP CONTAINER SETTINGS
128128
remove_volumes: false,
129129
force_remove_containers: false,
130-
//JENKINS SLAVE CONFIG
130+
//JENKINS AGENT CONFIG
131131
remote_fs_root: "/home/jenkins",
132132
labels: "stable docker ubuntu1604 sudo language:groovy env jdk",
133133
//valid values: exclusive or normal
@@ -143,17 +143,17 @@ clouds_yadocker = [
143143
launch_ssh_port: 22,
144144
launch_ssh_java_path: "",
145145
launch_ssh_jvm_options: "",
146-
launch_ssh_prefix_start_slave_command: "",
147-
launch_ssh_suffix_start_slave_command: "",
146+
launch_ssh_prefix_start_agent_command: "",
147+
launch_ssh_suffix_start_agent_command: "",
148148
launch_ssh_connection_timeout: 120,
149149
launch_ssh_max_num_retries: 10,
150150
launch_ssh_time_wait_between_retries: 10,
151151
//settings specific to launch_jnlp
152152
launch_jnlp_linux_user: "jenkins",
153153
launch_jnlp_launch_timeout: 120,
154-
launch_jnlp_slave_jar_options: "",
155-
launch_jnlp_slave_jvm_options: "",
156-
launch_jnlp_different_jenkins_master_url: "",
154+
launch_jnlp_agent_jar_options: "",
155+
launch_jnlp_agent_jvm_options: "",
156+
launch_jnlp_different_jenkins_controller_url: "",
157157
launch_jnlp_ignore_certificate_check: false,
158158
//NODE PROPERTIES
159159
//environment_variables is a HashMap of key/value pairs
@@ -186,8 +186,8 @@ def selectLauncher(String launcherType, JSONObject obj) {
186186
obj.optString('launch_ssh_credentials_id'),
187187
obj.optString('launch_ssh_jvm_options'),
188188
obj.optString('launch_ssh_java_path'),
189-
obj.optString('launch_ssh_prefix_start_slave_command'),
190-
obj.optString('launch_ssh_suffix_start_slave_command'),
189+
obj.optString('launch_ssh_prefix_start_agent_command'),
190+
obj.optString('launch_ssh_suffix_start_agent_command'),
191191
obj.optInt('launch_ssh_connection_timeout'),
192192
obj.optInt('launch_ssh_max_num_retries'),
193193
obj.optInt('launch_ssh_time_wait_between_retries')
@@ -197,9 +197,9 @@ def selectLauncher(String launcherType, JSONObject obj) {
197197
DockerComputerJNLPLauncher dockerComputerJNLPLauncher = new DockerComputerJNLPLauncher()
198198
dockerComputerJNLPLauncher.setUser(obj.optString('launch_jnlp_linux_user','jenkins'))
199199
dockerComputerJNLPLauncher.setLaunchTimeout(obj.optLong('launch_jnlp_launch_timeout', 120L))
200-
dockerComputerJNLPLauncher.setSlaveOpts(obj.optString('launch_jnlp_slave_jar_options'))
201-
dockerComputerJNLPLauncher.setJvmOpts(obj.optString('launch_jnlp_slave_jvm_options'))
202-
dockerComputerJNLPLauncher.setJenkinsUrl(obj.optString('launch_jnlp_different_jenkins_master_url'))
200+
dockerComputerJNLPLauncher.setSlaveOpts(obj.optString('launch_jnlp_agent_jar_options'))
201+
dockerComputerJNLPLauncher.setJvmOpts(obj.optString('launch_jnlp_agent_jvm_options'))
202+
dockerComputerJNLPLauncher.setJenkinsUrl(obj.optString('launch_jnlp_different_jenkins_controller_url'))
203203
dockerComputerJNLPLauncher.setNoCertificateCheck(obj.optBoolean('launch_jnlp_ignore_certificate_check', false))
204204
return dockerComputerJNLPLauncher
205205
default:

scripts/credentials-multitype.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ import org.jenkinsci.plugins.plaincredentials.impl.StringCredentialsImpl
6565
plugin without requiring that it be installed if an admin does not need to
6666
configure SSH agents.
6767
68-
This script will succeed both with and without the SSH slaves plugin
68+
This script will succeed both with and without the SSH Build Agents plugin
6969
installed.
7070
*/
7171
Class loadClass(String clazz) {

scripts/upgrade/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Plugins are stored at [`repo.jenkins-ci.org`][2]. Gradle is used to download
4949
plugins using [GAV coordinates][3]. When running `upgrade_build_gradle.sh`,
5050
a local Jenkins instance is upgraded and all of the plugins are upgraded. Once
5151
Jenkins is upgraded then `build.gradle` and `dependencies.gradle` is updated
52-
with the new Jenkins master and plugin versions.
52+
with the new Jenkins controller and plugin versions.
5353

5454
### Override Jenkins Update Center
5555

scripts/upgrade/upgrade_build_gradle.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ if [ -n "${USE_GRADLE_PROPERTIES:-}" ]; then
5959
VERSION="${VERSION%.*}.$(( ${VERSION##*.} + 1 ))"
6060
fi
6161

62-
#write jenkins master and plugin versions to build.gradle and dependencies.gradle
62+
#write jenkins controller and plugin versions to build.gradle and dependencies.gradle
6363
"${SCRIPT_LIBRARY_PATH}"/upgrade/remote_dependencies.sh
6464

6565
# GNU or BSD sed is required. Homebrew on Mac installs GNU sed as gsed.

0 commit comments

Comments
 (0)