From 3c09876079c5367a4f765b1e4da9fd12ea1dfa87 Mon Sep 17 00:00:00 2001 From: surenpi Date: Mon, 9 Oct 2017 18:57:37 +0800 Subject: [PATCH 01/29] Add Chinese translation --- .../AllView/newViewDetail_zh_CN.properties | 23 +++++++++++++++ .../model/Job/configure_zh_CN.properties | 1 + .../hudson/model/Job/rename_zh_CN.properties | 28 +++++++++++++++++++ .../configure-entries_zh_CN.properties | 2 ++ .../ListView/newJobButtonBar_zh_CN.properties | 23 +++++++++++++++ .../MyView/newViewDetail_zh_CN.properties | 24 ++++++++++++++++ .../MyViewsProperty/config_zh_CN.properties | 24 ++++++++++++++++ .../hudson/model/User/builds_zh_CN.properties | 22 +++++++++++++++ .../model/User/configure_zh_CN.properties | 2 ++ .../hudson/model/User/delete_zh_CN.properties | 24 ++++++++++++++++ .../hudson/model/View/delete_zh_CN.properties | 24 ++++++++++++++++ 11 files changed, 197 insertions(+) create mode 100644 core/src/main/resources/hudson/model/AllView/newViewDetail_zh_CN.properties create mode 100644 core/src/main/resources/hudson/model/Job/rename_zh_CN.properties create mode 100644 core/src/main/resources/hudson/model/ListView/newJobButtonBar_zh_CN.properties create mode 100644 core/src/main/resources/hudson/model/MyView/newViewDetail_zh_CN.properties create mode 100644 core/src/main/resources/hudson/model/MyViewsProperty/config_zh_CN.properties create mode 100644 core/src/main/resources/hudson/model/User/builds_zh_CN.properties create mode 100644 core/src/main/resources/hudson/model/User/delete_zh_CN.properties create mode 100644 core/src/main/resources/hudson/model/View/delete_zh_CN.properties diff --git a/core/src/main/resources/hudson/model/AllView/newViewDetail_zh_CN.properties b/core/src/main/resources/hudson/model/AllView/newViewDetail_zh_CN.properties new file mode 100644 index 0000000000..38dc4d8bc8 --- /dev/null +++ b/core/src/main/resources/hudson/model/AllView/newViewDetail_zh_CN.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright (c) 2017, suren +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +blurb=\u8BE5\u89C6\u56FE\u663E\u793AJenkins\u4E2D\u6240\u6709\u7684\u4EFB\u52A1\u3002 diff --git a/core/src/main/resources/hudson/model/Job/configure_zh_CN.properties b/core/src/main/resources/hudson/model/Job/configure_zh_CN.properties index 307ce3d03f..18ccf96a6a 100644 --- a/core/src/main/resources/hudson/model/Job/configure_zh_CN.properties +++ b/core/src/main/resources/hudson/model/Job/configure_zh_CN.properties @@ -22,6 +22,7 @@ Description=\u63CF\u8FF0 LOADING=\u52A0\u8F7D\u4E2D +Apply=\u5E94\u7528 Save=\u4FDD\u5B58 Strategy=\u7B56\u7565 name=\u9879\u76EE\u540D\u79F0 diff --git a/core/src/main/resources/hudson/model/Job/rename_zh_CN.properties b/core/src/main/resources/hudson/model/Job/rename_zh_CN.properties new file mode 100644 index 0000000000..0ddc3baefd --- /dev/null +++ b/core/src/main/resources/hudson/model/Job/rename_zh_CN.properties @@ -0,0 +1,28 @@ +# The MIT License +# +# Copyright (c) 2017, suren +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +noRenameWhileBuilding=\u4E0D\u5141\u8BB8\u91CD\u547D\u540D\u6B63\u5728\u6784\u5EFA\u4E2D\u7684\u4EFB\u52A1\u3002 +newNameInUse=\u8BE5\u547D\u540D {0} \u5DF2\u7ECF\u88AB\u5360\u7528\u3002 +newNameNotValid=\u8BE5\u547D\u540D {0} \u4E0D\u5408\u6CD5\u3002 +configWasSaved=All other configuration options were saved. +description=\u4F60\u786E\u5B9A\u628A {0} \u91CD\u547D\u540D\u4E3A {1}\uFF1F +Yes=\u786E\u5B9A diff --git a/core/src/main/resources/hudson/model/ListView/configure-entries_zh_CN.properties b/core/src/main/resources/hudson/model/ListView/configure-entries_zh_CN.properties index ef3bfb7ba1..5b6ea514ed 100644 --- a/core/src/main/resources/hudson/model/ListView/configure-entries_zh_CN.properties +++ b/core/src/main/resources/hudson/model/ListView/configure-entries_zh_CN.properties @@ -28,4 +28,6 @@ Enabled\ jobs\ only=\u53EA\u663E\u793A\u542F\u7528\u7684Jobs Job\ Filters=Job\u8FC7\u6EE4\u5668 Regular\ expression=\u6B63\u5219\u8868\u8FBE\u5F0F Status\ Filter=\u72B6\u6001\u8FC7\u6EE4 +Recurse\ in\ subfolders=\u904D\u5386\u5B50\u6587\u4EF6\u5939 +Jobs=\u4EFB\u52A1\u5217\u8868 Use\ a\ regular\ expression\ to\ include\ jobs\ into\ the\ view=\u4F7F\u7528\u6B63\u5219\u8868\u8FBE\u5F0F\u5728\u89C6\u56FE\u4E2D\u663E\u793AJobs diff --git a/core/src/main/resources/hudson/model/ListView/newJobButtonBar_zh_CN.properties b/core/src/main/resources/hudson/model/ListView/newJobButtonBar_zh_CN.properties new file mode 100644 index 0000000000..d5345a7bad --- /dev/null +++ b/core/src/main/resources/hudson/model/ListView/newJobButtonBar_zh_CN.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright (c) 2017, suren +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +Add\ to\ current\ view=\u6DFB\u52A0\u5230\u5F53\u524D\u89C6\u56FE diff --git a/core/src/main/resources/hudson/model/MyView/newViewDetail_zh_CN.properties b/core/src/main/resources/hudson/model/MyView/newViewDetail_zh_CN.properties new file mode 100644 index 0000000000..fba0db8a81 --- /dev/null +++ b/core/src/main/resources/hudson/model/MyView/newViewDetail_zh_CN.properties @@ -0,0 +1,24 @@ +# The MIT License +# +# Copyright (c) 2017, suren +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +blurb=\ + \u8BE5\u89C6\u56FE\u81EA\u52A8\u663E\u793A\u5F53\u524D\u7528\u6237\u6709\u6743\u9650\u8BBF\u95EE\u7684\u4EFB\u52A1 \ No newline at end of file diff --git a/core/src/main/resources/hudson/model/MyViewsProperty/config_zh_CN.properties b/core/src/main/resources/hudson/model/MyViewsProperty/config_zh_CN.properties new file mode 100644 index 0000000000..e55b3d3499 --- /dev/null +++ b/core/src/main/resources/hudson/model/MyViewsProperty/config_zh_CN.properties @@ -0,0 +1,24 @@ +# The MIT License +# +# Copyright (c) 2017, suren +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +Default\ View=\u9ED8\u8BA4\u89C6\u56FE +description=\u5F53\u5BFC\u822A\u4E3A\u7528\u6237\u7684\u79C1\u6709\u89C6\u56FE\u65F6\u5C06\u4F1A\u9ED8\u8BA4\u9009\u62E9\u8BE5\u89C6\u56FE \ No newline at end of file diff --git a/core/src/main/resources/hudson/model/User/builds_zh_CN.properties b/core/src/main/resources/hudson/model/User/builds_zh_CN.properties new file mode 100644 index 0000000000..88416f2cca --- /dev/null +++ b/core/src/main/resources/hudson/model/User/builds_zh_CN.properties @@ -0,0 +1,22 @@ +# The MIT License +# +# Copyright (c) 2017, suren +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +title={0}\u7684\u6784\u5EFA diff --git a/core/src/main/resources/hudson/model/User/configure_zh_CN.properties b/core/src/main/resources/hudson/model/User/configure_zh_CN.properties index 2e69b48878..3de7eb49ce 100644 --- a/core/src/main/resources/hudson/model/User/configure_zh_CN.properties +++ b/core/src/main/resources/hudson/model/User/configure_zh_CN.properties @@ -1,4 +1,6 @@ # This file is under the MIT License by authors +title=\u7528\u6237 ''{0}'' \u914D\u7F6E Description=\u63cf\u8ff0 Full\ name=\u8d26\u53f7\u540d\u79f0 +Save=\u4FDD\u5B58 \ No newline at end of file diff --git a/core/src/main/resources/hudson/model/User/delete_zh_CN.properties b/core/src/main/resources/hudson/model/User/delete_zh_CN.properties new file mode 100644 index 0000000000..2ea812e80a --- /dev/null +++ b/core/src/main/resources/hudson/model/User/delete_zh_CN.properties @@ -0,0 +1,24 @@ +# The MIT License +# +# Copyright (c) 2017, suren +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +Are\ you\ sure\ about\ deleting\ the\ user\ from\ Jenkins?=\u4F60\u786E\u5B9A\u8981\u4ECEJenkins\u4E2D\u5220\u9664\u8BE5\u7528\u6237\u5417\uFF1F +Yes=\u786E\u5B9A diff --git a/core/src/main/resources/hudson/model/View/delete_zh_CN.properties b/core/src/main/resources/hudson/model/View/delete_zh_CN.properties new file mode 100644 index 0000000000..a5babeee82 --- /dev/null +++ b/core/src/main/resources/hudson/model/View/delete_zh_CN.properties @@ -0,0 +1,24 @@ +# The MIT License +# +# Copyright (c) 2017, suren +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +Are\ you\ sure\ about\ deleting\ the\ view?=\u4F60\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u89C6\u56FE\u5417\uFF1F +Yes=\u786E\u5B9A From e376780c649523c32d3acc0140ed47b45aa57464 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 11 Oct 2017 16:43:06 -0400 Subject: [PATCH 02/29] [JENKINS-47393] Preparation for split of CommandLauncher to a plugin. --- command-launcher-plugin/pom.xml | 52 +++++++++++ .../java/hudson/slaves/CommandConnector.java | 23 ++--- .../java/hudson/slaves/CommandLauncher.java | 46 +++++---- .../command_launcher/CommandLanguage.java | 55 +++++++++++ .../slaves/CommandConnector/config.jelly | 0 .../CommandConnector/config_bg.properties | 0 .../CommandConnector/config_de.properties | 0 .../CommandConnector/config_es.properties | 0 .../CommandConnector/config_ja.properties | 0 .../CommandConnector/config_pt_BR.properties | 0 .../CommandConnector/config_sr.properties | 0 .../CommandConnector/config_zh_TW.properties | 0 .../slaves/CommandLauncher/config.jelly | 0 .../CommandLauncher/config_bg.properties | 0 .../CommandLauncher/config_da.properties | 0 .../CommandLauncher/config_de.properties | 0 .../CommandLauncher/config_es.properties | 0 .../CommandLauncher/config_fr.properties | 0 .../CommandLauncher/config_ja.properties | 0 .../CommandLauncher/config_pt_BR.properties | 0 .../CommandLauncher/config_ru.properties | 0 .../CommandLauncher/config_sr.properties | 0 .../CommandLauncher/config_sv_SE.properties | 0 .../CommandLauncher/config_tr.properties | 0 .../CommandLauncher/config_zh_TW.properties | 0 .../slaves/CommandLauncher/help-command.html | 0 .../CommandLauncher/help-command_bg.html | 0 .../CommandLauncher/help-command_fr.html | 0 .../CommandLauncher/help-command_ja.html | 0 .../CommandLauncher/help-command_ru.html | 0 .../hudson/slaves/CommandLauncher/help.jelly | 0 .../slaves/CommandLauncher/help.properties | 0 .../slaves/CommandLauncher/help_bg.properties | 0 .../slaves/CommandLauncher/help_de.properties | 0 .../slaves/CommandLauncher/help_es.properties | 0 .../slaves/CommandLauncher/help_sr.properties | 0 .../src/main/resources/index.jelly | 4 + .../command_launcher/Messages.properties | 26 ++++++ .../command_launcher/Messages_bg.properties | 6 ++ .../command_launcher/Messages_da.properties | 1 + .../command_launcher/Messages_de.properties | 4 + .../command_launcher/Messages_es.properties | 3 + .../command_launcher/Messages_fr.properties | 1 + .../command_launcher/Messages_ja.properties | 1 + .../command_launcher/Messages_lt.properties | 2 + .../Messages_pt_BR.properties | 1 + .../command_launcher/Messages_sr.properties | 4 + .../Messages_zh_TW.properties | 1 + .../hudson/slaves/CommandConnectorTest.java | 2 +- .../hudson/slaves/CommandLauncher2Test.java | 93 +++++++++++++------ .../hudson/slaves/CommandLauncherTest.java | 0 .../ancientSerialForm/config.xml | 21 +++++ .../java/hudson/ClassicPluginStrategy.java | 5 +- core/src/main/java/hudson/model/Slave.java | 17 ++-- .../hudson/model/Messages.properties | 2 - .../hudson/model/Messages_bg.properties | 6 -- .../hudson/model/Messages_de.properties | 2 - .../hudson/model/Messages_es.properties | 2 - .../hudson/model/Messages_lt.properties | 2 - .../hudson/model/Messages_sr.properties | 2 - .../hudson/slaves/Messages.properties | 3 - .../hudson/slaves/Messages_bg.properties | 5 - .../hudson/slaves/Messages_da.properties | 1 - .../hudson/slaves/Messages_de.properties | 2 - .../hudson/slaves/Messages_es.properties | 1 - .../hudson/slaves/Messages_fr.properties | 1 - .../hudson/slaves/Messages_ja.properties | 1 - .../hudson/slaves/Messages_pt_BR.properties | 1 - .../hudson/slaves/Messages_sr.properties | 4 +- .../hudson/slaves/Messages_zh_TW.properties | 1 - pom.xml | 1 + test/pom.xml | 12 +++ .../jenkins/tasks/SimpleBuildWrapperTest.java | 4 +- war/pom.xml | 8 ++ 74 files changed, 326 insertions(+), 103 deletions(-) create mode 100644 command-launcher-plugin/pom.xml rename {core => command-launcher-plugin}/src/main/java/hudson/slaves/CommandConnector.java (75%) rename {core => command-launcher-plugin}/src/main/java/hudson/slaves/CommandLauncher.java (77%) create mode 100644 command-launcher-plugin/src/main/java/org/jenkinsci/plugins/command_launcher/CommandLanguage.java rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandConnector/config.jelly (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandConnector/config_bg.properties (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandConnector/config_de.properties (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandConnector/config_es.properties (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandConnector/config_ja.properties (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandConnector/config_pt_BR.properties (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandConnector/config_sr.properties (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandConnector/config_zh_TW.properties (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/config.jelly (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/config_bg.properties (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/config_da.properties (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/config_de.properties (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/config_es.properties (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/config_fr.properties (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/config_ja.properties (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/config_pt_BR.properties (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/config_ru.properties (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/config_sr.properties (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/config_sv_SE.properties (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/config_tr.properties (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/config_zh_TW.properties (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/help-command.html (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/help-command_bg.html (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/help-command_fr.html (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/help-command_ja.html (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/help-command_ru.html (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/help.jelly (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/help.properties (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/help_bg.properties (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/help_de.properties (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/help_es.properties (100%) rename {core => command-launcher-plugin}/src/main/resources/hudson/slaves/CommandLauncher/help_sr.properties (100%) create mode 100644 command-launcher-plugin/src/main/resources/index.jelly create mode 100644 command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages.properties create mode 100644 command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_bg.properties create mode 100644 command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_da.properties create mode 100644 command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_de.properties create mode 100644 command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_es.properties create mode 100644 command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_fr.properties create mode 100644 command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_ja.properties create mode 100644 command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_lt.properties create mode 100644 command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_pt_BR.properties create mode 100644 command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_sr.properties create mode 100644 command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_zh_TW.properties rename test/src/test/java/hudson/slaves/ComputerConnectorTest.java => command-launcher-plugin/src/test/java/hudson/slaves/CommandConnectorTest.java (95%) rename {test => command-launcher-plugin}/src/test/java/hudson/slaves/CommandLauncher2Test.java (63%) rename {test => command-launcher-plugin}/src/test/java/hudson/slaves/CommandLauncherTest.java (100%) create mode 100644 command-launcher-plugin/src/test/resources/hudson/slaves/CommandLauncher2Test/ancientSerialForm/config.xml diff --git a/command-launcher-plugin/pom.xml b/command-launcher-plugin/pom.xml new file mode 100644 index 0000000000..4367e6f6e4 --- /dev/null +++ b/command-launcher-plugin/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + + org.jenkins-ci.plugins + plugin + 2.34 + + + command-launcher + 1.0-SNAPSHOT + hpi + + 2.85-SNAPSHOT + 8 + + Command Launcher Plugin + Allows agents to be launched using a specified command. + https://wiki.jenkins-ci.org/display/JENKINS/Command+Launcher+Plugin + + + MIT License + http://opensource.org/licenses/MIT + + + + + + repo.jenkins-ci.org + https://repo.jenkins-ci.org/public/ + + + + + repo.jenkins-ci.org + https://repo.jenkins-ci.org/public/ + + + + + org.jenkins-ci.plugins + script-security + 1.18.1 + + + diff --git a/core/src/main/java/hudson/slaves/CommandConnector.java b/command-launcher-plugin/src/main/java/hudson/slaves/CommandConnector.java similarity index 75% rename from core/src/main/java/hudson/slaves/CommandConnector.java rename to command-launcher-plugin/src/main/java/hudson/slaves/CommandConnector.java index be23463986..ec44836b95 100644 --- a/core/src/main/java/hudson/slaves/CommandConnector.java +++ b/command-launcher-plugin/src/main/java/hudson/slaves/CommandConnector.java @@ -28,11 +28,13 @@ import hudson.Extension; import hudson.Util; import hudson.model.TaskListener; import hudson.util.FormValidation; -import org.jenkinsci.Symbol; -import org.kohsuke.stapler.DataBoundConstructor; - import java.io.IOException; -import jenkins.model.Jenkins; +import org.jenkinsci.Symbol; +import org.jenkinsci.plugins.command_launcher.CommandLanguage; +import org.jenkinsci.plugins.command_launcher.Messages; +import org.jenkinsci.plugins.scriptsecurity.scripts.ApprovalContext; +import org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval; +import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.QueryParameter; /** @@ -46,17 +48,19 @@ public class CommandConnector extends ComputerConnector { @DataBoundConstructor public CommandConnector(String command) { this.command = command; - Jenkins.getInstance().checkPermission(Jenkins.RUN_SCRIPTS); + // TODO add withKey if we can determine the Cloud.name being configured + ScriptApproval.get().configuring(command, CommandLanguage.get(), ApprovalContext.create().withCurrentUser()); } private Object readResolve() { - Jenkins.getInstance().checkPermission(Jenkins.RUN_SCRIPTS); + ScriptApproval.get().configuring(command, CommandLanguage.get(), ApprovalContext.create()); return this; } @Override public CommandLauncher launch(String host, TaskListener listener) throws IOException, InterruptedException { - return new CommandLauncher(command,new EnvVars("SLAVE",host)); + // no need to call ScriptApproval.using here; CommandLauncher.launch will do that + return new CommandLauncher(new EnvVars("SLAVE", host), command); } @Extension @Symbol("command") @@ -67,13 +71,10 @@ public class CommandConnector extends ComputerConnector { } public FormValidation doCheckCommand(@QueryParameter String value) { - if (!Jenkins.getInstance().hasPermission(Jenkins.RUN_SCRIPTS)) { - return FormValidation.warning(Messages.CommandLauncher_cannot_be_configured_by_non_administrato()); - } if (Util.fixEmptyAndTrim(value) == null) { return FormValidation.error(Messages.CommandLauncher_NoLaunchCommand()); } else { - return FormValidation.ok(); + return ScriptApproval.get().checking(value, CommandLanguage.get()); } } diff --git a/core/src/main/java/hudson/slaves/CommandLauncher.java b/command-launcher-plugin/src/main/java/hudson/slaves/CommandLauncher.java similarity index 77% rename from core/src/main/java/hudson/slaves/CommandLauncher.java rename to command-launcher-plugin/src/main/java/hudson/slaves/CommandLauncher.java index 2e42131863..8a4e3dc1ab 100644 --- a/core/src/main/java/hudson/slaves/CommandLauncher.java +++ b/command-launcher-plugin/src/main/java/hudson/slaves/CommandLauncher.java @@ -33,7 +33,6 @@ import hudson.model.Slave; import jenkins.model.Jenkins; import hudson.model.TaskListener; import hudson.remoting.Channel; -import hudson.security.ACL; import hudson.util.StreamCopyThread; import hudson.util.FormValidation; import hudson.util.ProcessTree; @@ -45,6 +44,10 @@ import java.util.logging.Logger; import org.apache.commons.lang.StringUtils; import org.jenkinsci.Symbol; +import org.jenkinsci.plugins.command_launcher.CommandLanguage; +import org.jenkinsci.plugins.scriptsecurity.scripts.ApprovalContext; +import org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval; +import org.jenkinsci.plugins.scriptsecurity.scripts.UnapprovedUsageException; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.QueryParameter; @@ -67,19 +70,30 @@ public class CommandLauncher extends ComputerLauncher { */ private final EnvVars env; + /** Constructor for use from UI. Conditionally approves the script. */ @DataBoundConstructor public CommandLauncher(String command) { - this(command, null); + agentCommand = command; + env = null; + // TODO add withKey if we can determine the Slave.nodeName being configured + ScriptApproval.get().configuring(command, CommandLanguage.get(), ApprovalContext.create().withCurrentUser()); } + /** Constructor for programmatic use. Always approves the script. */ public CommandLauncher(String command, EnvVars env) { this.agentCommand = command; this.env = env; - Jenkins.getInstance().checkPermission(Jenkins.RUN_SCRIPTS); + ScriptApproval.get().preapprove(command, CommandLanguage.get()); + } + + /** Constructor for use from {@link CommandConnector}. Never approves the script. */ + CommandLauncher(EnvVars env, String command) { + this.agentCommand = command; + this.env = env; } private Object readResolve() { - Jenkins.getInstance().checkPermission(Jenkins.RUN_SCRIPTS); + ScriptApproval.get().configuring(agentCommand, CommandLanguage.get(), ApprovalContext.create()); return this; } @@ -104,14 +118,15 @@ public class CommandLauncher extends ComputerLauncher { throw new AbortException("Cannot launch commands on deleted nodes"); } - listener.getLogger().println(hudson.model.Messages.Slave_Launching(getTimestamp())); - if(getCommand().trim().length()==0) { - listener.getLogger().println(Messages.CommandLauncher_NoLaunchCommand()); + listener.getLogger().println(org.jenkinsci.plugins.command_launcher.Messages.Slave_Launching(getTimestamp())); + String command = ScriptApproval.get().using(getCommand(), CommandLanguage.get()); + if (command.trim().length() == 0) { + listener.getLogger().println(org.jenkinsci.plugins.command_launcher.Messages.CommandLauncher_NoLaunchCommand()); return; } - listener.getLogger().println("$ " + getCommand()); + listener.getLogger().println("$ " + command); - ProcessBuilder pb = new ProcessBuilder(Util.tokenize(getCommand())); + ProcessBuilder pb = new ProcessBuilder(Util.tokenize(command)); final EnvVars cookie = _cookie = EnvVars.createCookie(); pb.environment().putAll(cookie); pb.environment().put("WORKSPACE", StringUtils.defaultString(computer.getAbsoluteRemoteFs(), node.getRemoteFS())); //path for local slave log @@ -153,6 +168,8 @@ public class CommandLauncher extends ComputerLauncher { LOGGER.info("agent launched for " + computer.getDisplayName()); } catch (InterruptedException e) { Functions.printStackTrace(e, listener.error(Messages.ComputerLauncher_abortedLaunch())); + } catch (UnapprovedUsageException e) { + listener.error(e.getMessage()); } catch (RuntimeException e) { Functions.printStackTrace(e, listener.error(Messages.ComputerLauncher_unexpectedError())); } catch (Error e) { @@ -167,7 +184,7 @@ public class CommandLauncher extends ComputerLauncher { msg = " : " + msg; // FIXME TODO i18n what is this!? } - msg = hudson.model.Messages.Slave_UnableToLaunch(computer.getDisplayName(), msg); + msg = org.jenkinsci.plugins.command_launcher.Messages.Slave_UnableToLaunch(computer.getDisplayName(), msg); LOGGER.log(Level.SEVERE, msg, e); Functions.printStackTrace(e, listener.error(msg)); @@ -196,17 +213,14 @@ public class CommandLauncher extends ComputerLauncher { @Extension @Symbol("command") public static class DescriptorImpl extends Descriptor { public String getDisplayName() { - return Messages.CommandLauncher_displayName(); + return org.jenkinsci.plugins.command_launcher.Messages.CommandLauncher_displayName(); } public FormValidation doCheckCommand(@QueryParameter String value) { - if (!Jenkins.getInstance().hasPermission(Jenkins.RUN_SCRIPTS)) { - return FormValidation.warning(Messages.CommandLauncher_cannot_be_configured_by_non_administrato()); - } if(Util.fixEmptyAndTrim(value)==null) - return FormValidation.error(Messages.CommandLauncher_NoLaunchCommand()); + return FormValidation.error(org.jenkinsci.plugins.command_launcher.Messages.CommandLauncher_NoLaunchCommand()); else - return FormValidation.ok(); + return ScriptApproval.get().checking(value, CommandLanguage.get()); } } } diff --git a/command-launcher-plugin/src/main/java/org/jenkinsci/plugins/command_launcher/CommandLanguage.java b/command-launcher-plugin/src/main/java/org/jenkinsci/plugins/command_launcher/CommandLanguage.java new file mode 100644 index 0000000000..3bbcb631b2 --- /dev/null +++ b/command-launcher-plugin/src/main/java/org/jenkinsci/plugins/command_launcher/CommandLanguage.java @@ -0,0 +1,55 @@ +/* + * The MIT License + * + * Copyright 2017 CloudBees, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package org.jenkinsci.plugins.command_launcher; + +import hudson.Extension; +import hudson.ExtensionList; +import hudson.Util; +import org.jenkinsci.plugins.scriptsecurity.scripts.Language; +import org.kohsuke.accmod.Restricted; +import org.kohsuke.accmod.restrictions.NoExternalUse; + +/** + * Language for launched processes, as per {@link Util#tokenize(String)} and {@link ProcessBuilder}. + */ +@Restricted(NoExternalUse.class) // TODO move to script-security +@Extension +public class CommandLanguage extends Language { + + public static Language get() { + return ExtensionList.lookup(Language.class).get(CommandLanguage.class); + } + + @Override + public String getName() { + return "command"; + } + + @Override + public String getDisplayName() { + return "External Commands"; + } + +} diff --git a/core/src/main/resources/hudson/slaves/CommandConnector/config.jelly b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config.jelly similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandConnector/config.jelly rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config.jelly diff --git a/core/src/main/resources/hudson/slaves/CommandConnector/config_bg.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_bg.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandConnector/config_bg.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_bg.properties diff --git a/core/src/main/resources/hudson/slaves/CommandConnector/config_de.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_de.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandConnector/config_de.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_de.properties diff --git a/core/src/main/resources/hudson/slaves/CommandConnector/config_es.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_es.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandConnector/config_es.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_es.properties diff --git a/core/src/main/resources/hudson/slaves/CommandConnector/config_ja.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_ja.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandConnector/config_ja.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_ja.properties diff --git a/core/src/main/resources/hudson/slaves/CommandConnector/config_pt_BR.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_pt_BR.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandConnector/config_pt_BR.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_pt_BR.properties diff --git a/core/src/main/resources/hudson/slaves/CommandConnector/config_sr.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_sr.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandConnector/config_sr.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_sr.properties diff --git a/core/src/main/resources/hudson/slaves/CommandConnector/config_zh_TW.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_zh_TW.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandConnector/config_zh_TW.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_zh_TW.properties diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/config.jelly b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config.jelly similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/config.jelly rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config.jelly diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/config_bg.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_bg.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/config_bg.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_bg.properties diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/config_da.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_da.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/config_da.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_da.properties diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/config_de.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_de.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/config_de.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_de.properties diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/config_es.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_es.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/config_es.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_es.properties diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/config_fr.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_fr.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/config_fr.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_fr.properties diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/config_ja.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_ja.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/config_ja.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_ja.properties diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/config_pt_BR.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_pt_BR.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/config_pt_BR.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_pt_BR.properties diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/config_ru.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_ru.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/config_ru.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_ru.properties diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/config_sr.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_sr.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/config_sr.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_sr.properties diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/config_sv_SE.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_sv_SE.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/config_sv_SE.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_sv_SE.properties diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/config_tr.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_tr.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/config_tr.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_tr.properties diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/config_zh_TW.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_zh_TW.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/config_zh_TW.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_zh_TW.properties diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/help-command.html b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command.html similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/help-command.html rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command.html diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/help-command_bg.html b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_bg.html similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/help-command_bg.html rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_bg.html diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/help-command_fr.html b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_fr.html similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/help-command_fr.html rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_fr.html diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/help-command_ja.html b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_ja.html similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/help-command_ja.html rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_ja.html diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/help-command_ru.html b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_ru.html similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/help-command_ru.html rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_ru.html diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/help.jelly b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help.jelly similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/help.jelly rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help.jelly diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/help.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/help.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help.properties diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/help_bg.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_bg.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/help_bg.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_bg.properties diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/help_de.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_de.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/help_de.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_de.properties diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/help_es.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_es.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/help_es.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_es.properties diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/help_sr.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_sr.properties similarity index 100% rename from core/src/main/resources/hudson/slaves/CommandLauncher/help_sr.properties rename to command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_sr.properties diff --git a/command-launcher-plugin/src/main/resources/index.jelly b/command-launcher-plugin/src/main/resources/index.jelly new file mode 100644 index 0000000000..257eb16b8f --- /dev/null +++ b/command-launcher-plugin/src/main/resources/index.jelly @@ -0,0 +1,4 @@ + +
+ Allows agents to be launched using a specified command. +
diff --git a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages.properties b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages.properties new file mode 100644 index 0000000000..2790853798 --- /dev/null +++ b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages.properties @@ -0,0 +1,26 @@ +# The MIT License +# +# Copyright 2017 CloudBees, Inc. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +Slave.Launching={0} Launching agent +CommandLauncher.NoLaunchCommand=No launch command specified +CommandLauncher.displayName=Launch agent via execution of command on the master +Slave.UnableToLaunch=Unable to launch the agent for {0}{1} diff --git a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_bg.properties b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_bg.properties new file mode 100644 index 0000000000..d8498302b3 --- /dev/null +++ b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_bg.properties @@ -0,0 +1,6 @@ +CommandLauncher.NoLaunchCommand=\ + \u041d\u0435 \u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430 \u0441\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u043d\u0435. +CommandLauncher.displayName=\ + \u0421\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u043d\u0435 \u043d\u0430 \u0430\u0433\u0435\u043d\u0442 \u0447\u0440\u0435\u0437 \u0441\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u043d\u0435 \u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u044e\u0442\u044a\u0440 +Slave.UnableToLaunch=\ + \u0410\u0433\u0435\u043d\u0442\u044a\u0442 \u0437\u0430 {0}{1} \u043d\u0435 \u043c\u043e\u0436\u0435 \u0434\u0430 \u0441\u0435 \u0441\u0442\u0430\u0440\u0442\u0438\u0440\u0430 diff --git a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_da.properties b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_da.properties new file mode 100644 index 0000000000..128e8976df --- /dev/null +++ b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_da.properties @@ -0,0 +1 @@ +CommandLauncher.NoLaunchCommand=Ingen opstartskommando givet diff --git a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_de.properties b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_de.properties new file mode 100644 index 0000000000..da38fe9129 --- /dev/null +++ b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_de.properties @@ -0,0 +1,4 @@ +Slave.Launching=Starte Agenten +CommandLauncher.NoLaunchCommand=Kein Startkommando angegeben. +CommandLauncher.displayName=Agent durch Ausf\u00FChrung eines Befehls auf dem Master-Knoten starten +Slave.UnableToLaunch=Kann Agent \u201E{0}\u201C nicht starten{1} diff --git a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_es.properties b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_es.properties new file mode 100644 index 0000000000..648acd84f8 --- /dev/null +++ b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_es.properties @@ -0,0 +1,3 @@ +Slave.Launching={0} Arrancando el agente +CommandLauncher.NoLaunchCommand=No se ha especificado ningún comando +Slave.UnableToLaunch=Imposible ejecutar el agente en {0}{1} diff --git a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_fr.properties b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_fr.properties new file mode 100644 index 0000000000..2dcfbc4fa5 --- /dev/null +++ b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_fr.properties @@ -0,0 +1 @@ +CommandLauncher.NoLaunchCommand=Aucune commande de lancement sp\u00e9cifi\u00e9e diff --git a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_ja.properties b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_ja.properties new file mode 100644 index 0000000000..6917e336a9 --- /dev/null +++ b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_ja.properties @@ -0,0 +1 @@ +CommandLauncher.NoLaunchCommand=\u8d77\u52d5\u30b3\u30de\u30f3\u30c9\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002 diff --git a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_lt.properties b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_lt.properties new file mode 100644 index 0000000000..ebbe25751b --- /dev/null +++ b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_lt.properties @@ -0,0 +1,2 @@ +Slave.Launching={0} Paleid\u017eiamas agentas +Slave.UnableToLaunch=Nepavyksta paleisti agento skirto {0}{1} diff --git a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_pt_BR.properties b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_pt_BR.properties new file mode 100644 index 0000000000..e48bbf8e9f --- /dev/null +++ b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_pt_BR.properties @@ -0,0 +1 @@ +CommandLauncher.NoLaunchCommand=Sem nenhum comando de lan\u00e7amento especificado diff --git a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_sr.properties b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_sr.properties new file mode 100644 index 0000000000..0815fdadb3 --- /dev/null +++ b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_sr.properties @@ -0,0 +1,4 @@ +Slave.Launching={0} \u043F\u043E\u043A\u0440\u0435\u0442\u0430\u045A\u0435 \u0430\u0433\u0435\u043D\u0442\u043E\u043C +CommandLauncher.NoLaunchCommand=\u041D\u0438\u0458\u0435 \u043D\u0430\u0432\u0435\u0434\u0435\u043D\u043E \u043A\u043E\u043C\u0430\u043D\u0434\u0430 \u0437\u0430 \u043F\u043E\u043A\u0440\u0435\u0442\u0430\u045A\u0435. +CommandLauncher.displayName=\u041F\u043E\u043A\u0440\u0435\u043D\u0438 \u0430\u0433\u0435\u043D\u0442\u0430 \u0438\u0437\u0432\u0440\u0448\u0430\u0432\u0430\u045A\u0443 \u043A\u043E\u043C\u0430\u043D\u0434\u0435 \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u043E\u0458 \u043C\u0430\u0448\u0438\u043D\u0438 +Slave.UnableToLaunch=\u0410\u0433\u0435\u043D\u0430\u0442 \u0437\u0430 {0}{1} \u043D\u0435 \u043C\u043E\u0436\u0435 \u0434\u0430 \u0441\u0435 \u043F\u043E\u043A\u0440\u0435\u043D\u0435 diff --git a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_zh_TW.properties b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_zh_TW.properties new file mode 100644 index 0000000000..644a9967ee --- /dev/null +++ b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_zh_TW.properties @@ -0,0 +1 @@ +CommandLauncher.NoLaunchCommand=\u6c92\u6709\u6307\u5b9a\u555f\u52d5\u6307\u4ee4 diff --git a/test/src/test/java/hudson/slaves/ComputerConnectorTest.java b/command-launcher-plugin/src/test/java/hudson/slaves/CommandConnectorTest.java similarity index 95% rename from test/src/test/java/hudson/slaves/ComputerConnectorTest.java rename to command-launcher-plugin/src/test/java/hudson/slaves/CommandConnectorTest.java index 9112f4f10d..78ef369a6c 100644 --- a/test/src/test/java/hudson/slaves/ComputerConnectorTest.java +++ b/command-launcher-plugin/src/test/java/hudson/slaves/CommandConnectorTest.java @@ -28,7 +28,7 @@ import org.jvnet.hudson.test.HudsonTestCase; /** * @author Kohsuke Kawaguchi */ -public class ComputerConnectorTest extends HudsonTestCase { +public class CommandConnectorTest extends HudsonTestCase { public void testConfigRoundtrip() throws Exception { CommandConnector cc = new CommandConnector("abc def"); assertEqualDataBoundBeans(cc,configRoundtrip(cc)); diff --git a/test/src/test/java/hudson/slaves/CommandLauncher2Test.java b/command-launcher-plugin/src/test/java/hudson/slaves/CommandLauncher2Test.java similarity index 63% rename from test/src/test/java/hudson/slaves/CommandLauncher2Test.java rename to command-launcher-plugin/src/test/java/hudson/slaves/CommandLauncher2Test.java index 7d9a6bd4d4..1ba8c7d161 100644 --- a/test/src/test/java/hudson/slaves/CommandLauncher2Test.java +++ b/command-launcher-plugin/src/test/java/hudson/slaves/CommandLauncher2Test.java @@ -24,7 +24,6 @@ package hudson.slaves; -import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; import com.gargoylesoftware.htmlunit.HttpMethod; import com.gargoylesoftware.htmlunit.WebRequest; import com.gargoylesoftware.htmlunit.html.HtmlForm; @@ -37,19 +36,23 @@ import hudson.model.Computer; import hudson.model.User; import java.io.File; import java.io.IOException; -import java.net.HttpURLConnection; +import java.util.Collections; +import java.util.Set; import javax.annotation.CheckForNull; import jenkins.model.Jenkins; import org.apache.tools.ant.filters.StringInputStream; import static org.hamcrest.Matchers.*; -import org.junit.Test; +import org.jenkinsci.plugins.command_launcher.CommandLanguage; +import org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval; import static org.junit.Assert.*; import org.junit.Rule; +import org.junit.Test; import org.junit.runners.model.Statement; import org.jvnet.hudson.test.Issue; import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.MockAuthorizationStrategy; import org.jvnet.hudson.test.RestartableJenkinsRule; +import org.jvnet.hudson.test.recipes.LocalData; public class CommandLauncher2Test { @@ -58,14 +61,15 @@ public class CommandLauncher2Test { @Issue("SECURITY-478") @Test - public void requireRunScripts() throws Exception { - rr.addStep(new Statement() { + public void requireApproval() throws Exception { + rr.addStep(new Statement() { // TODO .then, when using sufficiently new jenkins-test-harness @Override public void evaluate() throws Throwable { rr.j.jenkins.setSecurityRealm(rr.j.createDummySecurityRealm()); rr.j.jenkins.setAuthorizationStrategy(new MockAuthorizationStrategy(). grant(Jenkins.ADMINISTER).everywhere().to("admin"). grant(Jenkins.READ, Computer.CONFIGURE).everywhere().to("dev")); + ScriptApproval.get().preapprove("echo unconfigured", CommandLanguage.get()); DumbSlave s = new DumbSlave("s", "/", new CommandLauncher("echo unconfigured")); rr.j.jenkins.addNode(s); // First, reconfigure using GUI. @@ -95,48 +99,58 @@ public class CommandLauncher2Test { assertThat(new CLICommandInvoker(rr.j, cmd).withStdin(new StringInputStream(xml.replace("echo configured by GUI", "echo configured by CLI"))).invokeWithArgs("s"), CLICommandInvoker.Matcher.succeededSilently()); s = (DumbSlave) rr.j.jenkins.getNode("s"); assertEquals("echo configured by CLI", ((CommandLauncher) s.getLauncher()).getCommand()); + assertEquals(Collections.emptySet(), ScriptApproval.get().getPendingScripts()); assertSerialForm(s, "echo configured by CLI"); // Now verify that all modes failed as dev. First as GUI. + ScriptApproval.get().preapprove("echo configured by admin", CommandLanguage.get()); s.setLauncher(new CommandLauncher("echo configured by admin")); s.save(); wc = rr.j.createWebClient().login("dev"); form = wc.getPage(s, "configure").getFormByName("config"); input = form.getInputByName("_.command"); assertEquals("echo configured by admin", input.getText()); - input.setText("echo ATTACK"); - try { - rr.j.submit(form); - fail(); - } catch (FailingHttpStatusCodeException x) { - assertEquals("403 would be more natural but Descriptor.newInstance wraps AccessDeniedException2 in Error", 500, x.getStatusCode()); - } + input.setText("echo GUI ATTACK"); + rr.j.submit(form); s = (DumbSlave) rr.j.jenkins.getNode("s"); - assertEquals("echo configured by admin", ((CommandLauncher) s.getLauncher()).getCommand()); - assertSerialForm(s, "echo configured by admin"); + assertEquals("echo GUI ATTACK", ((CommandLauncher) s.getLauncher()).getCommand()); + Set pendingScripts = ScriptApproval.get().getPendingScripts(); + assertEquals(1, pendingScripts.size()); + ScriptApproval.PendingScript pendingScript = pendingScripts.iterator().next(); + assertEquals(CommandLanguage.get(), pendingScript.getLanguage()); + assertEquals("echo GUI ATTACK", pendingScript.script); + assertEquals("dev", pendingScript.getContext().getUser()); + ScriptApproval.get().denyScript(pendingScript.getHash()); + assertSerialForm(s, "echo GUI ATTACK"); // Then by REST. req = new WebRequest(wc.createCrumbedUrl(configDotXml), HttpMethod.POST); req.setEncodingType(null); - req.setRequestBody(xml.replace("echo configured by GUI", "echo ATTACK")); - try { - wc.getPage(req); - } catch (FailingHttpStatusCodeException x) { - assertEquals(HttpURLConnection.HTTP_FORBIDDEN, x.getStatusCode()); - } + req.setRequestBody(xml.replace("echo configured by GUI", "echo REST ATTACK")); + wc.getPage(req); s = (DumbSlave) rr.j.jenkins.getNode("s"); - assertNotEquals(CommandLauncher.class, s.getLauncher().getClass()); // currently seems to reset it to JNLPLauncher, whatever - assertSerialForm(s, null); - s.setLauncher(new CommandLauncher("echo configured by admin")); + assertEquals("echo REST ATTACK", ((CommandLauncher) s.getLauncher()).getCommand()); + pendingScripts = ScriptApproval.get().getPendingScripts(); + assertEquals(1, pendingScripts.size()); + pendingScript = pendingScripts.iterator().next(); + assertEquals(CommandLanguage.get(), pendingScript.getLanguage()); + assertEquals("echo REST ATTACK", pendingScript.script); + assertEquals(/* deserialization, not recording user */ null, pendingScript.getContext().getUser()); + ScriptApproval.get().denyScript(pendingScript.getHash()); + assertSerialForm(s, "echo REST ATTACK"); // Then by CLI. cmd = new UpdateNodeCommand(); cmd.setTransportAuth(User.get("dev").impersonate()); - assertThat(new CLICommandInvoker(rr.j, cmd).withStdin(new StringInputStream(xml.replace("echo configured by GUI", "echo ATTACK"))).invokeWithArgs("s"), - CLICommandInvoker.Matcher./* gets swallowed by RobustReflectionConverter, hmm*/succeededSilently()); + assertThat(new CLICommandInvoker(rr.j, cmd).withStdin(new StringInputStream(xml.replace("echo configured by GUI", "echo CLI ATTACK"))).invokeWithArgs("s"), CLICommandInvoker.Matcher.succeededSilently()); s = (DumbSlave) rr.j.jenkins.getNode("s"); - assertNotEquals(CommandLauncher.class, s.getLauncher().getClass()); - assertSerialForm(s, null); + assertEquals("echo CLI ATTACK", ((CommandLauncher) s.getLauncher()).getCommand()); + pendingScripts = ScriptApproval.get().getPendingScripts(); + assertEquals(1, pendingScripts.size()); + pendingScript = pendingScripts.iterator().next(); + assertEquals(CommandLanguage.get(), pendingScript.getLanguage()); + assertEquals("echo CLI ATTACK", pendingScript.script); + assertEquals(/* ditto */null, pendingScript.getContext().getUser()); + ScriptApproval.get().denyScript(pendingScript.getHash()); + assertSerialForm(s, "echo CLI ATTACK"); // Now also check that SYSTEM deserialization works after a restart. - s.setLauncher(new CommandLauncher("echo configured by admin")); - s.save(); } private void assertSerialForm(DumbSlave s, @CheckForNull String expectedCommand) throws IOException { // cf. private methods in Nodes @@ -149,7 +163,26 @@ public class CommandLauncher2Test { @Override public void evaluate() throws Throwable { DumbSlave s = (DumbSlave) rr.j.jenkins.getNode("s"); - assertEquals("echo configured by admin", ((CommandLauncher) s.getLauncher()).getCommand()); + assertEquals("echo CLI ATTACK", ((CommandLauncher) s.getLauncher()).getCommand()); + Set pendingScripts = ScriptApproval.get().getPendingScripts(); + assertEquals(1, pendingScripts.size()); + ScriptApproval.PendingScript pendingScript = pendingScripts.iterator().next(); + assertEquals(CommandLanguage.get(), pendingScript.getLanguage()); + assertEquals("echo CLI ATTACK", pendingScript.script); + assertEquals(/* ditto */null, pendingScript.getContext().getUser()); + } + }); + } + + @LocalData // saved by Hudson 1.215 + @Test + public void ancientSerialForm() { + rr.addStep(new Statement() { + @Override + public void evaluate() throws Throwable { + ComputerLauncher launcher = ((DumbSlave) rr.j.jenkins.getNode("test")).getLauncher(); + assertThat(launcher, instanceOf(CommandLauncher.class)); + assertEquals("echo from CLI", ((CommandLauncher) launcher).getCommand()); } }); } diff --git a/test/src/test/java/hudson/slaves/CommandLauncherTest.java b/command-launcher-plugin/src/test/java/hudson/slaves/CommandLauncherTest.java similarity index 100% rename from test/src/test/java/hudson/slaves/CommandLauncherTest.java rename to command-launcher-plugin/src/test/java/hudson/slaves/CommandLauncherTest.java diff --git a/command-launcher-plugin/src/test/resources/hudson/slaves/CommandLauncher2Test/ancientSerialForm/config.xml b/command-launcher-plugin/src/test/resources/hudson/slaves/CommandLauncher2Test/ancientSerialForm/config.xml new file mode 100644 index 0000000000..ae8a30d973 --- /dev/null +++ b/command-launcher-plugin/src/test/resources/hudson/slaves/CommandLauncher2Test/ancientSerialForm/config.xml @@ -0,0 +1,21 @@ + + + 2 + + + + + + test + + /tmp + 1 + NORMAL + echo from CLI + + + + 5 + 0 + ede47f10a483fb5bcc4ffe063a7890b847c31baffcecb124305738bc0d969b3d + \ No newline at end of file diff --git a/core/src/main/java/hudson/ClassicPluginStrategy.java b/core/src/main/java/hudson/ClassicPluginStrategy.java index 5981ade069..0a274714e5 100644 --- a/core/src/main/java/hudson/ClassicPluginStrategy.java +++ b/core/src/main/java/hudson/ClassicPluginStrategy.java @@ -425,7 +425,8 @@ public class ClassicPluginStrategy implements PluginStrategy { new DetachedPlugin("antisamy-markup-formatter", "1.553.*", "1.0"), new DetachedPlugin("matrix-project", "1.561.*", "1.0"), new DetachedPlugin("junit", "1.577.*", "1.0"), - new DetachedPlugin("bouncycastle-api", "2.16.*", "2.16.0") + new DetachedPlugin("bouncycastle-api", "2.16.*", "2.16.0"), + new DetachedPlugin("command-launcher", "2.85.*", "1.0-SNAPSHOT") // TODO update after split )); /** Implicit dependencies that are known to be unnecessary and which must be cut out to prevent a dependency cycle among bundled plugins. */ @@ -434,6 +435,8 @@ public class ClassicPluginStrategy implements PluginStrategy { "script-security/windows-slaves", "script-security/antisamy-markup-formatter", "script-security/matrix-project", + "script-security/bouncycastle-api", + "script-security/command-launcher", "credentials/matrix-auth", "credentials/windows-slaves" )); diff --git a/core/src/main/java/hudson/model/Slave.java b/core/src/main/java/hudson/model/Slave.java index 3b9bbf42af..f83b5c06a3 100644 --- a/core/src/main/java/hudson/model/Slave.java +++ b/core/src/main/java/hudson/model/Slave.java @@ -26,6 +26,7 @@ package hudson.model; import com.google.common.collect.ImmutableSet; import hudson.DescriptorExtensionList; +import hudson.EnvVars; import hudson.FilePath; import hudson.Launcher; import hudson.Launcher.RemoteLauncher; @@ -34,7 +35,6 @@ import hudson.model.Descriptor.FormException; import hudson.remoting.Callable; import hudson.remoting.Channel; import hudson.remoting.Which; -import hudson.slaves.CommandLauncher; import hudson.slaves.ComputerLauncher; import hudson.slaves.DumbSlave; import hudson.slaves.JNLPLauncher; @@ -225,6 +225,15 @@ public abstract class Slave extends Node implements Serializable { } public ComputerLauncher getLauncher() { + if (launcher == null && !StringUtils.isEmpty(agentCommand)) { + try { + launcher = (ComputerLauncher) Jenkins.getInstance().getPluginManager().uberClassLoader.loadClass("hudson.slaves.CommandLauncher").getConstructor(String.class, EnvVars.class).newInstance(agentCommand, null); + agentCommand = null; + save(); + } catch (Exception x) { + LOGGER.log(Level.WARNING, "could not update historical agentCommand setting to CommandLauncher", x); + } + } // Default launcher does not use Work Directory return launcher == null ? new JNLPLauncher(false) : launcher; } @@ -502,12 +511,6 @@ public abstract class Slave extends Node implements Serializable { * Invoked by XStream when this object is read into memory. */ protected Object readResolve() { - // convert the old format to the new one - if (launcher == null) { - launcher = (agentCommand == null || agentCommand.trim().length() == 0) - ? new JNLPLauncher(false) - : new CommandLauncher(agentCommand); - } if(nodeProperties==null) nodeProperties = new DescribableList,NodePropertyDescriptor>(Jenkins.getInstance().getNodesObject()); return this; diff --git a/core/src/main/resources/hudson/model/Messages.properties b/core/src/main/resources/hudson/model/Messages.properties index 92812110fd..633b3b8967 100644 --- a/core/src/main/resources/hudson/model/Messages.properties +++ b/core/src/main/resources/hudson/model/Messages.properties @@ -239,14 +239,12 @@ Run.Summary.Unknown=? Slave.InvalidConfig.Executors=Invalid agent configuration for {0}. Invalid # of executors. Slave.InvalidConfig.NoName=Invalid agent configuration. Name is empty -Slave.Launching={0} Launching agent Slave.Network.Mounted.File.System.Warning=Are you sure you want to use network mounted file system for FS root? Note that this directory does not need to be visible to the master. Slave.Remote.Director.Mandatory=Remote directory is mandatory Slave.Terminated={0} agent was terminated Slave.Remote.Relative.Path.Warning=Are you sure you want to use a relative path for the FS root? Note that relative \ paths require that you can assure that the selected launcher provides a consistent current working directory. Using \ an absolute path is highly recommended. -Slave.UnableToLaunch=Unable to launch the agent for {0}{1} Slave.UnixSlave=This is a Unix agent Slave.WindowsSlave=This is a Windows agent diff --git a/core/src/main/resources/hudson/model/Messages_bg.properties b/core/src/main/resources/hudson/model/Messages_bg.properties index 34260ce072..550cbf6034 100644 --- a/core/src/main/resources/hudson/model/Messages_bg.properties +++ b/core/src/main/resources/hudson/model/Messages_bg.properties @@ -626,9 +626,6 @@ Computer.BadChannel=\ Computer.DisconnectPermission.Description=\ \u0422\u043e\u0432\u0430 \u043f\u0440\u0430\u0432\u043e \u0434\u0430\u0432\u0430 \u0432\u044a\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442 \u0434\u0430 \u043f\u0440\u0435\u043a\u044a\u0441\u0432\u0430\u0442\u0435 \u0432\u0440\u044a\u0437\u043a\u0430\u0442\u0430 \u043a\u044a\u043c \u0430\u0433\u0435\u043d\u0442\u0438 \u0438\u043b\u0438 \u0434\u0430 \u0433\u0438\ \u043e\u0431\u044f\u0432\u044f\u0432\u0430\u0442\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0438\u0437\u0432\u044a\u043d \u043b\u0438\u043d\u0438\u044f. -# Unable to launch the agent for {0}{1} -Slave.UnableToLaunch=\ - \u0410\u0433\u0435\u043d\u0442\u044a\u0442 \u0437\u0430 {0}{1} \u043d\u0435 \u043c\u043e\u0436\u0435 \u0434\u0430 \u0441\u0435 \u0441\u0442\u0430\u0440\u0442\u0438\u0440\u0430 # This permission allows users to run jobs as them on agents. Computer.BuildPermission.Description=\ \u0422\u043e\u0432\u0430 \u043f\u0440\u0430\u0432\u043e \u0434\u0430\u0432\u0430 \u0432\u044a\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442 \u043d\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0438\u0442\u0435 \u0434\u0430 \u0438\u0437\u043f\u044a\u043b\u043d\u044f\u0432\u0430\u0442 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430 \u0430\u0433\u0435\u043d\u0442\u0438\u0442\u0435\ @@ -691,9 +688,6 @@ Computer.DeletePermission.Description=\ # Agent Computer.Permissions.Title=\ \u0410\u0433\u0435\u043d\u0442 -# {0} Launching agent -Slave.Launching=\ - TODO # This is a Unix agent Slave.UnixSlave=\ \u0422\u043e\u0432\u0430 \u0435 \u0430\u0433\u0435\u043d\u0442 \u0437\u0430 Unix diff --git a/core/src/main/resources/hudson/model/Messages_de.properties b/core/src/main/resources/hudson/model/Messages_de.properties index 721322c837..11523a03f3 100644 --- a/core/src/main/resources/hudson/model/Messages_de.properties +++ b/core/src/main/resources/hudson/model/Messages_de.properties @@ -262,13 +262,11 @@ Run.Summary.Unknown=Ergebnis unbekannt Slave.InvalidConfig.Executors=Ung\u00FCltige Agenten-Konfiguration f\u00FCr \u201E{0}\u201C: Ung\u00FCltige Zahl von Build-Prozessoren Slave.InvalidConfig.NoName=Ung\u00FCltige Agenten-Konfiguration f\u00FCr \u201E{0}\u201C: Name ist leer -Slave.Launching=Starte Agenten Slave.Network.Mounted.File.System.Warning=\ Sind Sie sicher, dass Sie ein Netzlaufwerk als Stammverzeichnis verwenden m\u00F6chten? \ Hinweis: Dieses Verzeichnis muss nicht vom Master-Knoten aus sichtbar sein. Slave.Remote.Director.Mandatory=Ein Stammverzeichnis muss angegeben werden. Slave.Remote.Relative.Path.Warning=M\u00F6chten Sie wirklich einen relativen Pfad als Stammverzeichnis verwenden? Hierbei ist wichtig, dass die Startmethode des Agenten ein konsistentes Arbeitsverzeichnis bereit stellt. Es wird daher empfohlen, einen absoluten Pfad anzugeben. -Slave.UnableToLaunch=Kann Agent \u201E{0}\u201C nicht starten{1} Slave.UnixSlave=Dies ist ein Unix- oder Linux-Agent Slave.WindowsSlave=Dies ist ein Windows-Agent diff --git a/core/src/main/resources/hudson/model/Messages_es.properties b/core/src/main/resources/hudson/model/Messages_es.properties index 8d581e01e4..0d9c135727 100644 --- a/core/src/main/resources/hudson/model/Messages_es.properties +++ b/core/src/main/resources/hudson/model/Messages_es.properties @@ -154,9 +154,7 @@ Run.Summary.Unknown=? Slave.InvalidConfig.Executors=Configuraci\u00f3n de nodo incorrecta en {0}. El n\u00famero de ejecutores es inv\u00e1lido. Slave.InvalidConfig.NoName=Configuraci\u00f3n de nodo incorrecta. El nombre est\u00e1 vac\u00edo -Slave.Launching={0} Arrancando el agente Slave.Terminated={0} el agente no est\u00e1 en ejecuci\u00f3n -Slave.UnableToLaunch=Imposible ejecutar el agente en {0}{1} Slave.UnixSlave=Este es un nodo Unix Slave.WindowsSlave=Este es un nodo Windows diff --git a/core/src/main/resources/hudson/model/Messages_lt.properties b/core/src/main/resources/hudson/model/Messages_lt.properties index 48956866e5..e1786a842a 100644 --- a/core/src/main/resources/hudson/model/Messages_lt.properties +++ b/core/src/main/resources/hudson/model/Messages_lt.properties @@ -207,14 +207,12 @@ Run.Summary.Unknown=? Slave.InvalidConfig.Executors=Netinkama agento {0} konfig\u016bracija. Netinkamas vykdytoj\u0173 skai\u010dius. Slave.InvalidConfig.NoName=Netinkama agento konfig\u016bracija. Tu\u0161\u010dias pavadinimas -Slave.Launching={0} Paleid\u017eiamas agentas Slave.Network.Mounted.File.System.Warning=Ar tikrai norite naudoti per tinkl\u0105 prijungt\u0105 fail\u0173 sistem\u0105 kaip FS \u0161ank\u012f? Pasteb\u0117tina, kad \u0161is aplankas neb\u016btinai turi b\u016bti matomas pagrindiniam mazgui. Slave.Remote.Director.Mandatory=Nutol\u0119s aplankas yra privalomas Slave.Terminated={0} agentas buvo nutrauktas Slave.Remote.Relative.Path.Warning=Ar tikrai norite naudoti santykin\u012f keli\u0105, kaip FS \u0161akn\u012f? Pasteb\u0117tina, kad santykiniams \ keliams reikia, kad j\u016bs u\u017etikrintum\u0117te, kad parinktas paleid\u0117jas u\u017etikrina pastov\u0173 einam\u0105j\u012f darbin\u012f aplank\u0105. Primygtinai \ rekomenduojame naudoti absoliut\u0173 keli\u0105. -Slave.UnableToLaunch=Nepavyksta paleisti agento skirto {0}{1} Slave.UnixSlave=Tai Unix agentas Slave.WindowsSlave=Tai Windows agentas diff --git a/core/src/main/resources/hudson/model/Messages_sr.properties b/core/src/main/resources/hudson/model/Messages_sr.properties index d45e895c84..6a1b7ed6c3 100644 --- a/core/src/main/resources/hudson/model/Messages_sr.properties +++ b/core/src/main/resources/hudson/model/Messages_sr.properties @@ -181,12 +181,10 @@ Run.Summary.BrokenSince=\u0441\u043B\u043E\u043C\u0459\u0435\u043D\u043E \u043E\ Run.Summary.Unknown=\u041D/\u0414 Slave.InvalidConfig.Executors=\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u043D\u043E \u043F\u043E\u0434\u0435\u0448\u0430\u0432\u0430\u045A\u0435 \u043D\u0430 \u0430\u0433\u0435\u043D\u0442\u0443 \u0437\u0430 {0}. \u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u0430\u043D \u0431\u0440\u043E\u0458 \u0438\u0437\u0432\u0440\u0448\u0438\u0442\u0435\u0459\u0430. Slave.InvalidConfig.NoName=\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u043D\u043E \u043F\u043E\u0434\u0435\u0448\u0430\u0432\u0430\u045A\u0435 \u043D\u0430 \u0430\u0433\u0435\u043D\u0442\u0443 \u2014 \u0438\u043C\u0435 \u0458\u0435 \u043F\u0440\u0430\u0437\u043D\u043E. -Slave.Launching={0} \u043F\u043E\u043A\u0440\u0435\u0442\u0430\u045A\u0435 \u0430\u0433\u0435\u043D\u0442\u043E\u043C Slave.Network.Mounted.File.System.Warning=\u0414\u0430 \u043B\u0438 \u0441\u0442\u0435 \u0441\u0438\u0433\u0443\u0440\u043D\u0438 \u0434\u0430 \u0436\u0435\u043B\u0438\u0442\u0435 \u0434\u0430 \u043A\u043E\u0440\u0438\u0441\u0442\u0438\u0442\u0435 \u043C\u0440\u0435\u0436\u043D\u0438 \u0441\u0438\u0441\u0442\u0435\u043C \u0434\u0430\u0442\u043E\u0442\u0435\u043A\u0430 \u0437\u0430 \u043A\u043E\u0440\u0435\u043D \u0442\u043E\u0433 \u0441\u0438\u0441\u0442\u0435\u043C\u0430. \u0414\u0438\u0440\u0435\u043A\u0442\u043E\u0440\u0438\u0458\u0443\u043C \u043D\u0435\u043C\u043E\u0440\u0430 \u0431\u0438\u0442\u0438 \u0432\u0438\u0434\u0459\u0438\u0432 \u043A\u043E\u0440\u0438\u0441\u043D\u0438\u043A\u0443. Slave.Remote.Director.Mandatory=\u041E\u0431\u0430\u0432\u0435\u0437\u043D\u043E \u0458\u0435 \u0438\u043C\u0430\u0442\u0438 \u0434\u0438\u0440\u0435\u043A\u0442\u043E\u0440\u0438\u0458\u0443\u043C \u043D\u0430 \u0434\u0430\u0459\u0438\u043D\u0438 Slave.Terminated=\u0410\u0433\u0435\u043D\u0442 {0} \u0458\u0435 \u0443\u043A\u043B\u043E\u045A\u0435\u043D Slave.Remote.Relative.Path.Warning=\u0414\u0430 \u043B\u0438 \u0441\u0442\u0435 \u0441\u0438\u0433\u0443\u0440\u043D\u0438 \u0434\u0430 \u0436\u0435\u043B\u0438\u0442\u0435 \u0434\u0430 \u043A\u043E\u0440\u0438\u0441\u0442\u0438\u0442\u0435 \u0440\u0435\u043B\u0430\u0442\u0438\u0432\u043D\u0430 \u043F\u0443\u0442\u0435\u0432\u0430 \u0437\u0430 \u043A\u043E\u0440\u0435\u043D \u0441\u0438\u0441\u0442\u0435\u043C\u0430 \u0434\u0430\u0442\u043E\u0442\u0435\u043A\u0430. \u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u0435 \u0434\u0430 \u0438\u0437\u0430\u0431\u0440\u0430\u043D\u0438 \u043F\u0440\u043E\u0446\u0435\u0441 \u043F\u043E\u043A\u0440\u0435\u0442\u0430\u045A\u0430 \u043E\u0431\u0435\u0437\u0431\u0435\u0452\u0443\u0458\u0435 \u043A\u043E\u043D\u0441\u0438\u0441\u0442\u0435\u043D\u0442\u043D\u043E\u0433 \u0440\u0430\u0434\u043D\u043E\u0433 \u0434\u0438\u0440\u0435\u043A\u0442\u043E\u0440\u0438\u0458\u0443\u043C\u0430. \u041F\u0440\u0435\u043F\u043E\u0440\u0443\u0447\u0443\u0458\u0435 \u0441\u0435 \u0434\u0430 \u043A\u043E\u0440\u0438\u0441\u0442\u0438\u0442\u0435 \u0430\u043F\u0441\u043E\u043B\u0443\u0442\u043D\u0430 \u043F\u0443\u0442\u0435\u0432\u0430. -Slave.UnableToLaunch=\u0410\u0433\u0435\u043D\u0430\u0442 \u0437\u0430 {0}{1} \u043D\u0435 \u043C\u043E\u0436\u0435 \u0434\u0430 \u0441\u0435 \u043F\u043E\u043A\u0440\u0435\u043D\u0435 Slave.UnixSlave=\u041E\u0432\u043E \u0458\u0435 \u0430\u0433\u0435\u043D\u0442 \u0437\u0430 Unix TopLevelItemDescriptor.NotApplicableIn={0} \u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430 \u043D\u0435 \u043C\u043E\u0433\u0443 \u0441\u0435 \u043F\u0440\u0438\u043C\u0435\u043D\u0438\u0442\u0438 \u0443 {1} Slave.WindowsSlave=\u041E\u0432\u043E \u0458\u0435 \u0430\u0433\u0435\u043D\u0442 \u0437\u0430 Windows diff --git a/core/src/main/resources/hudson/slaves/Messages.properties b/core/src/main/resources/hudson/slaves/Messages.properties index 3e4b2f9b08..88d5ba72df 100644 --- a/core/src/main/resources/hudson/slaves/Messages.properties +++ b/core/src/main/resources/hudson/slaves/Messages.properties @@ -23,12 +23,9 @@ RetentionStrategy.Always.displayName=Keep this agent online as much as possible RetentionStrategy.Demand.displayName=Take this agent online when in demand, and offline when idle RetentionStrategy.Demand.OfflineIdle=Offline because computer was idle; it will be relaunched when needed. -CommandLauncher.displayName=Launch agent via execution of command on the master JNLPLauncher.displayName=Launch agent via Java Web Start ComputerLauncher.unexpectedError=Unexpected error in launching an agent. This is probably a bug in Jenkins ComputerLauncher.abortedLaunch=Launching agent process aborted. -CommandLauncher.cannot_be_configured_by_non_administrato=cannot be configured by non-administrators -CommandLauncher.NoLaunchCommand=No launch command specified ConnectionActivityMonitor.OfflineCause=Repeated ping attempts failed DumbSlave.displayName=Permanent Agent NodeProvisioner.EmptyString= diff --git a/core/src/main/resources/hudson/slaves/Messages_bg.properties b/core/src/main/resources/hudson/slaves/Messages_bg.properties index fccc9dd6a9..e861508055 100644 --- a/core/src/main/resources/hudson/slaves/Messages_bg.properties +++ b/core/src/main/resources/hudson/slaves/Messages_bg.properties @@ -22,8 +22,6 @@ RetentionStrategy.Demand.OfflineIdle=\ \u041d\u0435 \u0435 \u043d\u0430 \u043b\u0438\u043d\u0438\u044f, \u0437\u0430\u0449\u043e\u0442\u043e \u043a\u043e\u043c\u043f\u044e\u0442\u044a\u0440\u044a\u0442 \u0431\u0435\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0430. \u0429\u0435 \u0441\u0435 \u0441\u0442\u0430\u0440\u0442\u0438\u0440\u0430 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442. -CommandLauncher.NoLaunchCommand=\ - \u041d\u0435 \u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430 \u0441\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u043d\u0435. ConnectionActivityMonitor.OfflineCause=\ \u041c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u0438\u0442\u0435 \u043e\u043f\u0438\u0442\u0438 \u0437\u0430 \u0432\u0440\u044a\u0437\u043a\u0430 \u0447\u0440\u0435\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u0442\u0430 \u201eping\u201c \u0441\u0430 \u043d\u0435\u0443\u0441\u043f\u0435\u0448\u043d\u0438 NodeProvisioner.EmptyString=\ @@ -60,9 +58,6 @@ JNLPLauncher.displayName=\ # Keep this agent online as much as possible RetentionStrategy.Always.displayName=\ \u0410\u0433\u0435\u043d\u0442\u044a\u0442 \u0434\u0430 \u0435 \u043e\u043d\u043b\u0430\u0439\u043d \u043a\u043e\u043b\u043a\u043e\u0442\u043e \u043c\u043e\u0436\u0435 \u043f\u043e-\u0434\u044a\u043b\u0433\u043e -# Launch agent via execution of command on the master -CommandLauncher.displayName=\ - \u0421\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u043d\u0435 \u043d\u0430 \u0430\u0433\u0435\u043d\u0442 \u0447\u0440\u0435\u0437 \u0441\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u043d\u0435 \u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u044e\u0442\u044a\u0440 # This agent is offline because Jenkins failed to launch the agent process on it. OfflineCause.LaunchFailed=\ \u0410\u0433\u0435\u043d\u0442\u044a\u0442 \u043d\u0435 \u0435 \u043d\u0430 \u043b\u0438\u043d\u0438\u044f, \u0437\u0430\u0449\u043e\u0442\u043e Jenkins \u043d\u0435 \u0443\u0441\u043f\u044f \u0434\u0430 \u0441\u0442\u0430\u0440\u0442\u0438\u0440\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0430 \u043c\u0443. diff --git a/core/src/main/resources/hudson/slaves/Messages_da.properties b/core/src/main/resources/hudson/slaves/Messages_da.properties index ab97271a14..ed12c4fbb5 100644 --- a/core/src/main/resources/hudson/slaves/Messages_da.properties +++ b/core/src/main/resources/hudson/slaves/Messages_da.properties @@ -23,7 +23,6 @@ RetentionStrategy.Demand.OfflineIdle=Offline da computeren var i tomgang; vil blive genstartet n\u00e5r n\u00f8dvendigt. SimpleScheduledRetentionStrategy.FinishedUpTime=Computeren har afsluttet sin planlagte oppetid EnvironmentVariablesNodeProperty.displayName=Milj\u00f8variable -CommandLauncher.NoLaunchCommand=Ingen opstartskommando givet ConnectionActivityMonitor.OfflineCause=Gentagne pingfors\u00f8g fejlede SlaveComputer.DisconnectedBy=Frakoblet af {0}{1} NodeProvisioner.EmptyString= diff --git a/core/src/main/resources/hudson/slaves/Messages_de.properties b/core/src/main/resources/hudson/slaves/Messages_de.properties index 4b7b396a93..0509d510ff 100644 --- a/core/src/main/resources/hudson/slaves/Messages_de.properties +++ b/core/src/main/resources/hudson/slaves/Messages_de.properties @@ -21,8 +21,6 @@ # THE SOFTWARE. Cloud.ProvisionPermission.Description=Neue Agenten provisionieren -CommandLauncher.displayName=Agent durch Ausf\u00FChrung eines Befehls auf dem Master-Knoten starten -CommandLauncher.NoLaunchCommand=Kein Startkommando angegeben. ComputerLauncher.abortedLaunch=Start des Agenten-Prozesses abgebrochen ComputerLauncher.JavaVersionResult={0} -version ergab {1}. ComputerLauncher.NoJavaFound=Java-Version {0} gefunden, aber 1.7 oder neuer ist n\u00F6tig. diff --git a/core/src/main/resources/hudson/slaves/Messages_es.properties b/core/src/main/resources/hudson/slaves/Messages_es.properties index e12811db84..afb431f155 100644 --- a/core/src/main/resources/hudson/slaves/Messages_es.properties +++ b/core/src/main/resources/hudson/slaves/Messages_es.properties @@ -21,7 +21,6 @@ # THE SOFTWARE. RetentionStrategy.Demand.OfflineIdle=Fuera de línea porque no es necesario, el servicio se volverá a iniciar cuando haya demanda -CommandLauncher.NoLaunchCommand=No se ha especificado ningún comando ConnectionActivityMonitor.OfflineCause=No hubo respuesta a ''ping'' despues de varios intentos SimpleScheduledRetentionStrategy.FinishedUpTime=El nodo ha finalizado el tiempo programado de estar on-line EnvironmentVariablesNodeProperty.displayName=Variables de entorno diff --git a/core/src/main/resources/hudson/slaves/Messages_fr.properties b/core/src/main/resources/hudson/slaves/Messages_fr.properties index d044dac640..f4b4e0f63e 100644 --- a/core/src/main/resources/hudson/slaves/Messages_fr.properties +++ b/core/src/main/resources/hudson/slaves/Messages_fr.properties @@ -20,5 +20,4 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -CommandLauncher.NoLaunchCommand=Aucune commande de lancement sp\u00e9cifi\u00e9e EnvironmentVariablesNodeProperty.displayName=Variables d''environnement diff --git a/core/src/main/resources/hudson/slaves/Messages_ja.properties b/core/src/main/resources/hudson/slaves/Messages_ja.properties index a5bf2adebc..889f2793d7 100644 --- a/core/src/main/resources/hudson/slaves/Messages_ja.properties +++ b/core/src/main/resources/hudson/slaves/Messages_ja.properties @@ -21,7 +21,6 @@ # THE SOFTWARE. RetentionStrategy.Demand.OfflineIdle=\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u304c\u5f85\u6a5f\u4e2d\u306a\u306e\u3067\u30aa\u30d5\u30e9\u30a4\u30f3\u3067\u3059\u3002\u5fc5\u8981\u306b\u306a\u3063\u305f\u3089\u518d\u3073\u8d77\u52d5\u3057\u307e\u3059\u3002 -CommandLauncher.NoLaunchCommand=\u8d77\u52d5\u30b3\u30de\u30f3\u30c9\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002 ConnectionActivityMonitor.OfflineCause=\u4f55\u5ea6\u3082ping\u304c\u5931\u6557\u3057\u307e\u3057\u305f\u3002 NodeProvisioner.EmptyString= SimpleScheduledRetentionStrategy.FinishedUpTime=\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u306e\u52d5\u4f5c\u53ef\u80fd\u6642\u9593\u304c\u7d42\u4e86\u3057\u307e\u3057\u305f\u3002 diff --git a/core/src/main/resources/hudson/slaves/Messages_pt_BR.properties b/core/src/main/resources/hudson/slaves/Messages_pt_BR.properties index 9cd2f871d9..f0e4108f33 100644 --- a/core/src/main/resources/hudson/slaves/Messages_pt_BR.properties +++ b/core/src/main/resources/hudson/slaves/Messages_pt_BR.properties @@ -21,7 +21,6 @@ # THE SOFTWARE. # No launch command specified -CommandLauncher.NoLaunchCommand=Sem nenhum comando de lan\u00e7amento especificado # Offline because computer was idle; it will be relaunched when needed. RetentionStrategy.Demand.OfflineIdle=Offline porque o computador estava ocioso; ser\u00e1 relan\u00e7ado quando necess\u00e1rio. # Repeated ping attempts failed diff --git a/core/src/main/resources/hudson/slaves/Messages_sr.properties b/core/src/main/resources/hudson/slaves/Messages_sr.properties index 7c3235dec4..71e7c2b93b 100644 --- a/core/src/main/resources/hudson/slaves/Messages_sr.properties +++ b/core/src/main/resources/hudson/slaves/Messages_sr.properties @@ -3,12 +3,10 @@ RetentionStrategy.Always.displayName=\u0414\u0440\u0436\u0438 \u043E\u0432\u043E\u0433 \u0430\u0433\u0435\u043D\u0442\u0430 \u043F\u043E\u0432\u0435\u0437\u0430\u043D\u043E\u0433 \u043A\u043E\u043B\u0438\u043A\u043E \u0433\u043E\u0434 \u043C\u043E\u0433\u0443\u045B\u0435 RetentionStrategy.Demand.displayName=\u041F\u043E\u0432\u0435\u0436\u0438 \u043E\u0432\u043E\u0433 \u0430\u0433\u0435\u043D\u0442\u0430 \u043A\u0430\u0434\u0430 \u0431\u0443\u0434\u0435 \u0431\u0438\u043B\u043E \u043F\u043E\u0442\u0440\u0435\u0431\u043D\u043E, \u0430 \u043F\u0440\u0435\u043A\u0438\u043D\u0438 \u0432\u0435\u0437\u0443 \u043A\u0430\u0434\u0430 \u0437\u0430\u0441\u0442\u043E\u0458\u0438. RetentionStrategy.Demand.OfflineIdle=\u041D\u0438\u0458\u0435 \u043F\u043E\u0432\u0435\u0437\u0430\u043D\u043E, \u0458\u0435\u0440 \u0458\u0435 \u043C\u0430\u0448\u0438\u043D\u0430 \u0437\u0430\u0441\u0442\u043E\u0458\u0430\u043D\u0430. \u0411\u0438\u045B\u0435 \u043F\u043E\u043A\u0440\u0435\u043D\u0443\u0442 \u043A\u0430\u0434\u0430 \u0431\u0443\u0434\u0435 \u0431\u0438\u043B\u043E \u043F\u043E\u0442\u0440\u0435\u0431\u043D\u043E. -CommandLauncher.displayName=\u041F\u043E\u043A\u0440\u0435\u043D\u0438 \u0430\u0433\u0435\u043D\u0442\u0430 \u0438\u0437\u0432\u0440\u0448\u0430\u0432\u0430\u045A\u0443 \u043A\u043E\u043C\u0430\u043D\u0434\u0435 \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u043E\u0458 \u043C\u0430\u0448\u0438\u043D\u0438 JNLPLauncher.displayName=\u041F\u043E\u043A\u0440\u0435\u043D\u0438 \u0430\u0433\u0435\u043D\u0442\u0430 \u0441\u0430 Java Web Start ComputerLauncher.unexpectedError=\u041D\u0435\u043E\u0447\u0435\u043A\u0438\u0432\u0430\u043D\u0430 \u0433\u0440\u0435\u0448\u043A\u0430 \u043F\u0440\u0438\u043B\u0438\u043A\u043E\u043C \u043F\u043E\u043A\u0440\u0435\u0442\u0430\u045A\u0435 \u0430\u0433\u0435\u043D\u0442\u0430. \u041E\u0432\u043E \u0458\u0435 \u0432\u0435\u0440\u043E\u0432\u0430\u0442\u043D\u043E \u0433\u0440\u0435\u0448\u043A\u0430 \u0443 Jenkins. ComputerLauncher.abortedLaunch=\u041F\u0440\u043E\u0446\u0435\u0441 \u0437\u0430 \u043F\u043E\u043A\u0440\u0435\u0442\u0430\u045A\u0435 \u0430\u0433\u0435\u043D\u0442\u0430 \u0458\u0435 \u043F\u0440\u0435\u043A\u0438\u043D\u0443\u0442. ConnectionActivityMonitor.OfflineCause=\u041F\u043E\u043D\u043E\u0432\u0459\u0435\u043D\u0438 \u043F\u043E\u043A\u0443\u0448\u0430\u0458\u0438 \u0434\u0430 \u0441\u0435 \u0441\u0442\u0443\u043F\u0438 \u043A\u043E\u043D\u0442\u0430\u043A\u0442 \u043F\u0440\u0435\u043A\u043E \u043A\u043E\u043C\u0430\u043D\u0434\u0435 "ping" \u0441\u0443 \u043D\u0435\u0443\u0441\u043F\u0435\u0448\u043D\u0438. -CommandLauncher.NoLaunchCommand=\u041D\u0438\u0458\u0435 \u043D\u0430\u0432\u0435\u0434\u0435\u043D\u043E \u043A\u043E\u043C\u0430\u043D\u0434\u0430 \u0437\u0430 \u043F\u043E\u043A\u0440\u0435\u0442\u0430\u045A\u0435. DumbSlave.displayName=\u0421\u0442\u0430\u043B\u043D\u0438 \u0430\u0433\u0435\u043D\u0442 NodeProvisioner.EmptyString= OfflineCause.LaunchFailed=\u0410\u0433\u0435\u043D\u0442 \u043D\u0438\u0458\u0435 \u043F\u0440\u0438\u043A\u0459\u0443\u0447\u0435\u043D \u0458\u0435\u0440 Jenkins \u043D\u0438\u0458\u0435 \u0443\u0441\u043F\u0435\u043E \u0434\u0430 \u043F\u043E\u043A\u0440\u0435\u043D\u0435 \u043F\u0440\u043E\u0446\u0435\u0441 \u043D\u0430 \u045A\u0435\u0433\u0430. @@ -21,4 +19,4 @@ NodeDescripter.CheckName.Mandatory=\u0418\u043C\u0435 \u0458\u0435 \u043E\u0431\ ComputerLauncher.NoJavaFound=\u041F\u0440\u043E\u043D\u0430\u0452\u0435\u043D\u043E \u0458\u0435 Java \u0432\u0435\u0440\u0437\u0438\u0458\u0430 {0}, \u043C\u0435\u0452\u0443\u0442\u0438\u043C \u043F\u043E\u0442\u0440\u0435\u0431\u043D\u043E \u0458\u0435 \u0432\u0435\u0440\u0437\u0438\u0458\u0430 1.6. ComputerLauncher.JavaVersionResult=\u041A\u043E\u043C\u0430\u043D\u0434\u0430 {0} -version \u0458\u0435 \u0432\u0440\u0430\u0442\u0438\u043B\u043E {1}. ComputerLauncher.UknownJavaVersion=\u041D\u0438\u0458\u0435 \u043C\u043E\u0433\u0443\u045B\u0435 \u043E\u0434\u0440\u0435\u0434\u0438\u0438\u0442\u0438 Java \u0432\u0435\u0440\u0437\u0438\u0458\u0443 {0} -Cloud.ProvisionPermission.Description=\u041E\u0434\u0440\u0435\u0434\u0438 \u043D\u043E\u0432\u0435 \u043C\u0430\u0448\u0438\u043D\u0435 \ No newline at end of file +Cloud.ProvisionPermission.Description=\u041E\u0434\u0440\u0435\u0434\u0438 \u043D\u043E\u0432\u0435 \u043C\u0430\u0448\u0438\u043D\u0435 diff --git a/core/src/main/resources/hudson/slaves/Messages_zh_TW.properties b/core/src/main/resources/hudson/slaves/Messages_zh_TW.properties index 833fe20313..eff7e9df82 100644 --- a/core/src/main/resources/hudson/slaves/Messages_zh_TW.properties +++ b/core/src/main/resources/hudson/slaves/Messages_zh_TW.properties @@ -20,7 +20,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -CommandLauncher.NoLaunchCommand=\u6c92\u6709\u6307\u5b9a\u555f\u52d5\u6307\u4ee4 ComputerLauncher.JavaVersionResult={0} -version \u56de\u50b3 {1}\u3002 ComputerLauncher.NoJavaFound=\u627e\u5230 Java {0} \u7248\uff0c\u4e0d\u904e\u6211\u5011\u8981\u7684\u662f 1.5 \u6216\u66f4\u65b0\u7684\u7248\u672c\u3002 diff --git a/pom.xml b/pom.xml index f0e57d4d79..4824888915 100644 --- a/pom.xml +++ b/pom.xml @@ -49,6 +49,7 @@ THE SOFTWARE. core + command-launcher-plugin war test cli diff --git a/test/pom.xml b/test/pom.xml index 4d06f34a33..02933ef7f9 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -110,6 +110,12 @@ THE SOFTWARE. org.jenkins-ci.plugins matrix-project ${matrix-project.version} + + + org.jenkins-ci.plugins + script-security + + org.jenkins-ci.plugins @@ -123,6 +129,12 @@ THE SOFTWARE. 1.2 test + + org.jenkins-ci.plugins + command-launcher + 1.0-SNAPSHOT + test + org.jvnet.mock-javamail mock-javamail diff --git a/test/src/test/java/jenkins/tasks/SimpleBuildWrapperTest.java b/test/src/test/java/jenkins/tasks/SimpleBuildWrapperTest.java index b6c086c061..a967f33076 100644 --- a/test/src/test/java/jenkins/tasks/SimpleBuildWrapperTest.java +++ b/test/src/test/java/jenkins/tasks/SimpleBuildWrapperTest.java @@ -41,7 +41,7 @@ import hudson.model.JDK; import hudson.model.Run; import hudson.model.Slave; import hudson.model.TaskListener; -import hudson.slaves.CommandLauncher; +import hudson.slaves.ComputerLauncher; import hudson.slaves.NodeProperty; import hudson.slaves.RetentionStrategy; import hudson.slaves.SlaveComputer; @@ -126,7 +126,7 @@ public class SimpleBuildWrapperTest { } } private static class SpecialEnvSlave extends Slave { - SpecialEnvSlave(File remoteFS, CommandLauncher launcher) throws Descriptor.FormException, IOException { + SpecialEnvSlave(File remoteFS, ComputerLauncher launcher) throws Descriptor.FormException, IOException { super("special", "SpecialEnvSlave", remoteFS.getAbsolutePath(), 1, Mode.NORMAL, "", launcher, RetentionStrategy.NOOP, Collections.>emptyList()); } @Override public Computer createComputer() { diff --git a/war/pom.xml b/war/pom.xml index 4612568590..9655434cbe 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -404,6 +404,14 @@ THE SOFTWARE. 2.16.0 hpi + ${project.build.directory}/${project.build.finalName}/WEB-INF/detached-plugins true From e2a0792811a4a3adf07370738b4500996b3139c8 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 11 Oct 2017 17:01:47 -0400 Subject: [PATCH 03/29] CommandLanguage cannot easily be moved to script-security prior to split, because that would require updating the version of script-security in detached-plugins. Since this is restricted and the only trace in user settings is the language name `command`, this could be done in a 1.1 update of the plugin. --- .../org/jenkinsci/plugins/command_launcher/CommandLanguage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command-launcher-plugin/src/main/java/org/jenkinsci/plugins/command_launcher/CommandLanguage.java b/command-launcher-plugin/src/main/java/org/jenkinsci/plugins/command_launcher/CommandLanguage.java index 3bbcb631b2..852d87fe6c 100644 --- a/command-launcher-plugin/src/main/java/org/jenkinsci/plugins/command_launcher/CommandLanguage.java +++ b/command-launcher-plugin/src/main/java/org/jenkinsci/plugins/command_launcher/CommandLanguage.java @@ -34,7 +34,7 @@ import org.kohsuke.accmod.restrictions.NoExternalUse; /** * Language for launched processes, as per {@link Util#tokenize(String)} and {@link ProcessBuilder}. */ -@Restricted(NoExternalUse.class) // TODO move to script-security +@Restricted(NoExternalUse.class) // TODO move to script-security after split @Extension public class CommandLanguage extends Language { From 04994ed089533802a3f17dcfe7d3943e18c251a0 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 11 Oct 2017 17:35:22 -0400 Subject: [PATCH 04/29] Pick up https://github.com/jenkinsci/jenkins-test-harness/pull/79. --- test/pom.xml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/test/pom.xml b/test/pom.xml index 02933ef7f9..2c8bd30b02 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -53,7 +53,7 @@ THE SOFTWARE. ${project.groupId} jenkins-test-harness - 2.28 + 2.31-20171011.213336-1 test @@ -110,12 +110,6 @@ THE SOFTWARE. org.jenkins-ci.plugins matrix-project ${matrix-project.version} - - - org.jenkins-ci.plugins - script-security - - org.jenkins-ci.plugins @@ -129,12 +123,6 @@ THE SOFTWARE. 1.2 test - - org.jenkins-ci.plugins - command-launcher - 1.0-SNAPSHOT - test - org.jvnet.mock-javamail mock-javamail From 6181c8389968da60c831ddcfbcde7154ec744fce Mon Sep 17 00:00:00 2001 From: Devin Nusbaum Date: Fri, 13 Oct 2017 11:13:20 -0400 Subject: [PATCH 05/29] [JENKINS-36282] Add link to cc.xml?recursive from build history page --- core/src/main/resources/hudson/model/View/builds.jelly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/hudson/model/View/builds.jelly b/core/src/main/resources/hudson/model/View/builds.jelly index f7c1fc97c5..2c6b728f56 100644 --- a/core/src/main/resources/hudson/model/View/builds.jelly +++ b/core/src/main/resources/hudson/model/View/builds.jelly @@ -39,7 +39,7 @@ THE SOFTWARE.
From 7911eafc4c07be44810f7c870602c13d462f73d0 Mon Sep 17 00:00:00 2001 From: surenpi Date: Sat, 14 Oct 2017 16:31:46 +0800 Subject: [PATCH 06/29] Add Node Monitor Chinese translation --- .../help-freeSpaceThreshold_zh_CN.html | 4 ++ .../ArchitectureMonitor/help_zh_CN.html | 3 ++ .../ClockMonitor/help_zh_CN.html | 8 ++++ .../node_monitors/Messages_zh_CN.properties | 35 ++++++++++++++++ .../hudson/slaves/Messages_zh_CN.properties | 40 +++++++++++++++++++ .../ChannelTermination/cause_zh_CN.properties | 23 +++++++++++ .../LaunchFailed/cause_zh_CN.properties | 23 +++++++++++ .../SlaveComputer/disconnect_zh_CN.properties | 23 +++++++++++ .../SlaveComputer/systemInfo_zh_CN.properties | 26 ++++++++++++ 9 files changed, 185 insertions(+) create mode 100644 core/src/main/resources/hudson/node_monitors/AbstractDiskSpaceMonitor/help-freeSpaceThreshold_zh_CN.html create mode 100644 core/src/main/resources/hudson/node_monitors/ArchitectureMonitor/help_zh_CN.html create mode 100644 core/src/main/resources/hudson/node_monitors/ClockMonitor/help_zh_CN.html create mode 100644 core/src/main/resources/hudson/node_monitors/Messages_zh_CN.properties create mode 100644 core/src/main/resources/hudson/slaves/Messages_zh_CN.properties create mode 100644 core/src/main/resources/hudson/slaves/OfflineCause/ChannelTermination/cause_zh_CN.properties create mode 100644 core/src/main/resources/hudson/slaves/OfflineCause/LaunchFailed/cause_zh_CN.properties create mode 100644 core/src/main/resources/hudson/slaves/SlaveComputer/disconnect_zh_CN.properties create mode 100644 core/src/main/resources/hudson/slaves/SlaveComputer/systemInfo_zh_CN.properties diff --git a/core/src/main/resources/hudson/node_monitors/AbstractDiskSpaceMonitor/help-freeSpaceThreshold_zh_CN.html b/core/src/main/resources/hudson/node_monitors/AbstractDiskSpaceMonitor/help-freeSpaceThreshold_zh_CN.html new file mode 100644 index 0000000000..3ca9d83f46 --- /dev/null +++ b/core/src/main/resources/hudson/node_monitors/AbstractDiskSpaceMonitor/help-freeSpaceThreshold_zh_CN.html @@ -0,0 +1,4 @@ +
+ 这个选项配置代理的最小可用磁盘空间,使得可以执行适当的操作,例如"1.5GB", "100KB",等等。 + 如果发现一个代理的剩余磁盘空间小于该值,将会被下线。 +
\ No newline at end of file diff --git a/core/src/main/resources/hudson/node_monitors/ArchitectureMonitor/help_zh_CN.html b/core/src/main/resources/hudson/node_monitors/ArchitectureMonitor/help_zh_CN.html new file mode 100644 index 0000000000..2208da1f71 --- /dev/null +++ b/core/src/main/resources/hudson/node_monitors/ArchitectureMonitor/help_zh_CN.html @@ -0,0 +1,3 @@ +
+ 只是用于显示代理节点的架构信息,不会使得代理节点下线。 +
\ No newline at end of file diff --git a/core/src/main/resources/hudson/node_monitors/ClockMonitor/help_zh_CN.html b/core/src/main/resources/hudson/node_monitors/ClockMonitor/help_zh_CN.html new file mode 100644 index 0000000000..5a5623ac2f --- /dev/null +++ b/core/src/main/resources/hudson/node_monitors/ClockMonitor/help_zh_CN.html @@ -0,0 +1,8 @@ +
+ 监控管理节点和代理节点之间的时钟差异。 + 虽然Jenkins本身可以系统之间的时钟差,但是版本管理活动及分散式文件读取 + (例如 NFS 及 Windows 共享) 在系統之间有时间差会导致很奇怪的问题。 + +

+ 保持时钟同步的方法,参考 "NTP"。 +

diff --git a/core/src/main/resources/hudson/node_monitors/Messages_zh_CN.properties b/core/src/main/resources/hudson/node_monitors/Messages_zh_CN.properties new file mode 100644 index 0000000000..8a3ef44b2d --- /dev/null +++ b/core/src/main/resources/hudson/node_monitors/Messages_zh_CN.properties @@ -0,0 +1,35 @@ +# The MIT License +# +# Copyright (c) 2017, suren +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +ArchitectureMonitor.DisplayName=\u67B6\u6784 +ClockMonitor.DisplayName=\u65F6\u949F\u5DEE\u5F02 +DiskSpaceMonitor.MarkedOffline=\u7531\u4E8E\u7F3A\u5C11\u78C1\u76D8\u7A7A\u95F4\u4E34\u65F6\u6807\u8BB0 {0} \u79BB\u7EBF +DiskSpaceMonitor.MarkedOnline=\u6709\u8DB3\u591F\u7684\u78C1\u76D8\u7A7A\u95F4\u540E\u4F1A\u518D\u6B21\u8BA9 {0} \u4E0A\u7EBF +DiskSpaceMonitor.DisplayName=\u5269\u4F59\u78C1\u76D8\u7A7A\u95F4 +ResponseTimeMonitor.DisplayName=\u54CD\u5E94\u65F6\u95F4 +ResponseTimeMonitor.MarkedOffline=\u7531\u4E8E\u6CA1\u6709\u54CD\u5E94\u6807\u8BB0 {0} \u79BB\u7EBF +ResponseTimeMonitor.TimeOut={0} \u6B21\u91CD\u8BD5\u540E\u8D85\u65F6 +SwapSpaceMonitor.DisplayName=\u5269\u4F59\u4EA4\u6362\u7A7A\u95F4 +TemporarySpaceMonitor.DisplayName=\u5269\u4F59\u4E34\u65F6\u7A7A\u95F4 +AbstractNodeMonitorDescriptor.NoDataYet=\u65E0\u6570\u636E +DiskSpaceMonitorDescriptor.DiskSpace.FreeSpaceTooLow=\u78C1\u76D8\u7A7A\u95F4\u8FC7\u4F4E\uFF0C\u53EA\u5269\u4E0B {0}GB \u5728 {1}\u3002 +MonitorMarkedNodeOffline.DisplayName=\u6839\u636E\u5065\u5EB7\u68C0\u67E5\u8282\u70B9\u88AB\u6807\u8BB0\u4E3A\u79BB\u7EBF diff --git a/core/src/main/resources/hudson/slaves/Messages_zh_CN.properties b/core/src/main/resources/hudson/slaves/Messages_zh_CN.properties new file mode 100644 index 0000000000..c8ef214cd4 --- /dev/null +++ b/core/src/main/resources/hudson/slaves/Messages_zh_CN.properties @@ -0,0 +1,40 @@ +# The MIT License +# +# Copyright (c) 2017, suren +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +RetentionStrategy.Always.displayName=\u5C3D\u91CF\u4FDD\u6301\u4EE3\u7406\u5728\u7EBF +RetentionStrategy.Demand.displayName=\u6709\u9700\u8981\u7684\u65F6\u5019\u4FDD\u6301\u4EE3\u7406\u5728\u7EBF\uFF0C\u5F53\u7A7A\u95F2\u65F6\u79BB\u7EBF +RetentionStrategy.Demand.OfflineIdle=\u7531\u4E8E\u8282\u70B9\u7A7A\u95F2\u800C\u4E0B\u7EBF\uFF1B\u5B83\u4F1A\u5728\u9700\u8981\u7684\u65F6\u5019\u91CD\u542F\u3002 +CommandLauncher.displayName=\u901A\u8FC7\u5728\u7BA1\u7406\u8282\u70B9\u4E0A\u6267\u884C\u547D\u4EE4\u542F\u52A8 +JNLPLauncher.displayName=\u901A\u8FC7Java Web\u542F\u52A8\u4EE3\u7406 +ComputerLauncher.unexpectedError=\u542F\u52A8\u4EE3\u7406\u662F\u51FA\u73B0\u4F4D\u7F6E\u9519\u8BEF\u3002\u8FD9\u53EF\u80FD\u662FJenkins\u7684\u95EE\u9898\u3002 +ComputerLauncher.abortedLaunch=\u4EE3\u7406\u542F\u52A8\u8FC7\u7A0B\u88AB\u4E2D\u6B62\u3002 +CommandLauncher.NoLaunchCommand=\u6CA1\u6709\u6307\u5B9A\u542F\u52A8\u547D\u4EE4 +DumbSlave.displayName=\u56FA\u5B9A\u4EE3\u7406 +NodeProvisioner.EmptyString= +OfflineCause.LaunchFailed=\u7531\u4E8E\u4EE3\u7406\u542F\u52A8\u8FC7\u7A0B\u5931\u8D25\u5BFC\u81F4\u7684\u79BB\u7EBF\u3002 +OfflineCause.connection_was_broken_=\u8FDE\u63A5\u65AD\u5F00\uFF1A{0} +SimpleScheduledRetentionStrategy.displayName=\u6839\u636E\u65F6\u523B\u8868\u8BA9\u4EE3\u7406\u4E0A\u7EBF +EnvironmentVariablesNodeProperty.displayName=\u73AF\u5883\u53D8\u91CF +SlaveComputer.DisconnectedBy=\u88AB {0}{1}\u65AD\u5F00\u8FDE\u63A5 +NodeDescriptor.CheckName.Mandatory=\u540D\u79F0\u662F\u5FC5\u586B\u9879 +ComputerLauncher.NoJavaFound=\u627E\u5230\u7684Java\u7248\u672C\u4E3A {0} \u4F46\u662F\u9700\u89811.6\u53CA\u4EE5\u4E0A\u7684\u7248\u672C\u3002 +ComputerLauncher.UnknownJavaVersion=\u672A\u77E5\u7684Java\u7248\u672C {0} diff --git a/core/src/main/resources/hudson/slaves/OfflineCause/ChannelTermination/cause_zh_CN.properties b/core/src/main/resources/hudson/slaves/OfflineCause/ChannelTermination/cause_zh_CN.properties new file mode 100644 index 0000000000..4cb665671b --- /dev/null +++ b/core/src/main/resources/hudson/slaves/OfflineCause/ChannelTermination/cause_zh_CN.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright (c) 2017, suren +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +Connection\ was\ broken=\u8FDE\u63A5\u4E2D\u65AD diff --git a/core/src/main/resources/hudson/slaves/OfflineCause/LaunchFailed/cause_zh_CN.properties b/core/src/main/resources/hudson/slaves/OfflineCause/LaunchFailed/cause_zh_CN.properties new file mode 100644 index 0000000000..2daf3239d0 --- /dev/null +++ b/core/src/main/resources/hudson/slaves/OfflineCause/LaunchFailed/cause_zh_CN.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright (c) 2017, suren +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +See\ log\ for\ more\ details=\u4ECE\u65E5\u5FD7\u91CC\u53EF\u4EE5\u770B\u5230\u66F4\u8BE6\u7EC6\u7684\u5185\u5BB9 diff --git a/core/src/main/resources/hudson/slaves/SlaveComputer/disconnect_zh_CN.properties b/core/src/main/resources/hudson/slaves/SlaveComputer/disconnect_zh_CN.properties new file mode 100644 index 0000000000..aaa4ea2539 --- /dev/null +++ b/core/src/main/resources/hudson/slaves/SlaveComputer/disconnect_zh_CN.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright (c) 2017, suren +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +blurb=\u4F60\u53EF\u4EE5\u6DFB\u52A0\u8BA9\u8BE5\u8282\u70B9\u4E0B\u7EBF\u7684\u7406\u7531\uFF0C\u8FD9\u6837\u5176\u4ED6\u4EBA\u5C31\u80FD\u770B\u5230\u539F\u56E0\u4E86\u3002 diff --git a/core/src/main/resources/hudson/slaves/SlaveComputer/systemInfo_zh_CN.properties b/core/src/main/resources/hudson/slaves/SlaveComputer/systemInfo_zh_CN.properties new file mode 100644 index 0000000000..e37e96e1e6 --- /dev/null +++ b/core/src/main/resources/hudson/slaves/SlaveComputer/systemInfo_zh_CN.properties @@ -0,0 +1,26 @@ +# The MIT License +# +# Copyright (c) 2017, suren +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +System\ Information=\u7CFB\u7EDF\u4FE1\u606F +System\ Properties=\u7CFB\u7EDF\u5C5E\u6027 +Environment\ Variables=\u73AF\u5883\u53D8\u91CF +Thread\ Dump=\u7EBF\u7A0B\u6253\u5370 From 123e396bf4a42339b62313a83185233083f06e6d Mon Sep 17 00:00:00 2001 From: surenpi Date: Sat, 14 Oct 2017 20:56:41 +0800 Subject: [PATCH 07/29] Add view or job related Chinese translation --- .../config_zh_CN.properties | 24 +++++++++++++++++++ .../model/View/configure_zh_CN.properties | 1 + .../hudson/model/View/newJobButtonBar.jelly | 2 +- .../model/View/newJobButtonBar.properties | 1 + .../View/newJobButtonBar_zh_CN.properties | 1 + .../hudson/model/View/newJob_zh_CN.properties | 8 +++++-- 6 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 core/src/main/resources/hudson/model/BooleanParameterDefinition/config_zh_CN.properties create mode 100644 core/src/main/resources/hudson/model/View/newJobButtonBar.properties create mode 100644 core/src/main/resources/hudson/model/View/newJobButtonBar_zh_CN.properties diff --git a/core/src/main/resources/hudson/model/BooleanParameterDefinition/config_zh_CN.properties b/core/src/main/resources/hudson/model/BooleanParameterDefinition/config_zh_CN.properties new file mode 100644 index 0000000000..0703474e44 --- /dev/null +++ b/core/src/main/resources/hudson/model/BooleanParameterDefinition/config_zh_CN.properties @@ -0,0 +1,24 @@ +# The MIT License +# +# Copyright (c) 2017, suren +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +Name=\u540D\u79F0 +Default\ Value=\u9ED8\u8BA4\u503C +Description=\u8BF4\u660E diff --git a/core/src/main/resources/hudson/model/View/configure_zh_CN.properties b/core/src/main/resources/hudson/model/View/configure_zh_CN.properties index ad1c9b7dc2..d9d3dd4d7d 100644 --- a/core/src/main/resources/hudson/model/View/configure_zh_CN.properties +++ b/core/src/main/resources/hudson/model/View/configure_zh_CN.properties @@ -5,3 +5,4 @@ Filter\ build\ executors=\u8FC7\u6EE4\u6784\u5EFA\u6267\u884C\u5668 Filter\ build\ queue=\u8FC7\u6EE4\u6784\u5EFA\u961F\u5217 Name=\u540D\u79F0 OK=\u4FDD\u5B58 +Apply=\u5E94\u7528 diff --git a/core/src/main/resources/hudson/model/View/newJobButtonBar.jelly b/core/src/main/resources/hudson/model/View/newJobButtonBar.jelly index 9624f62b73..2b4ee0c185 100644 --- a/core/src/main/resources/hudson/model/View/newJobButtonBar.jelly +++ b/core/src/main/resources/hudson/model/View/newJobButtonBar.jelly @@ -24,5 +24,5 @@ THE SOFTWARE. - + diff --git a/core/src/main/resources/hudson/model/View/newJobButtonBar.properties b/core/src/main/resources/hudson/model/View/newJobButtonBar.properties new file mode 100644 index 0000000000..699b688fb6 --- /dev/null +++ b/core/src/main/resources/hudson/model/View/newJobButtonBar.properties @@ -0,0 +1 @@ +OK=OK \ No newline at end of file diff --git a/core/src/main/resources/hudson/model/View/newJobButtonBar_zh_CN.properties b/core/src/main/resources/hudson/model/View/newJobButtonBar_zh_CN.properties new file mode 100644 index 0000000000..bfae4d0e43 --- /dev/null +++ b/core/src/main/resources/hudson/model/View/newJobButtonBar_zh_CN.properties @@ -0,0 +1 @@ +OK=\u786E\u5B9A \ No newline at end of file diff --git a/core/src/main/resources/hudson/model/View/newJob_zh_CN.properties b/core/src/main/resources/hudson/model/View/newJob_zh_CN.properties index 87e0d02f0a..f8f0adb040 100644 --- a/core/src/main/resources/hudson/model/View/newJob_zh_CN.properties +++ b/core/src/main/resources/hudson/model/View/newJob_zh_CN.properties @@ -20,8 +20,12 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -#CopyExisting=\u590D\u5236\u73B0\u6709\u4EFB\u52A1 -#JobName=\u4EFB\u52A1\u540D\u79F0 CopyExisting=\u590D\u5236\u5DF2\u6709\u7684{0} JobName={0}\u540D\u79F0 +ItemName.validation.required=\u8BE5\u5B57\u6BB5\u4E0D\u80FD\u4E3A\u7A7A\uFF0C\u8BF7\u8F93\u5165\u4E00\u4E2A\u5408\u6CD5\u7684\u540D\u79F0 +ItemName.label=\u8F93\u5165\u4E00\u4E2A\u4EFB\u52A1\u540D\u79F0 +ItemName.help=\u5FC5\u586B\u9879 +CopyOption.label=\u590D\u5236 +CopyOption.placeholder=\u8F93\u5165\u81EA\u52A8\u5B8C\u6210 +CopyOption.description=\u5982\u679C\u4F60\u60F3\u6839\u636E\u4E00\u4E2A\u5DF2\u7ECF\u5B58\u5728\u7684\u4EFB\u52A1\u521B\u5EFA\uFF0C\u53EF\u4EE5\u4F7F\u7528\u8FD9\u4E2A\u9009\u9879 From 6a2e907e7d4c00ae673a054cc3c65feb24f559de Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Sun, 15 Oct 2017 18:38:39 -0400 Subject: [PATCH 08/29] [JENKINS-47416] ViewGroup.getUrl could throw NPE during deserialization, so do not call it from migrateLegacyPrimaryAllViewLocalizedName. --- core/src/main/java/hudson/model/AllView.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/hudson/model/AllView.java b/core/src/main/java/hudson/model/AllView.java index 8db2f352a1..4daedafd5a 100644 --- a/core/src/main/java/hudson/model/AllView.java +++ b/core/src/main/java/hudson/model/AllView.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.Locale; import java.util.logging.Level; import java.util.logging.Logger; -import javax.annotation.CheckForNull; import javax.annotation.Nonnull; import jenkins.util.SystemProperties; import org.apache.commons.lang.StringUtils; @@ -121,7 +120,7 @@ public class AllView extends View { * its name is one of the localized forms of {@link Messages#_Hudson_ViewName()} and the user has not opted out of * fixing the view name by setting the system property {@code hudson.mode.AllView.JENKINS-38606} to {@code false}. * Use this method to round-trip the primary view name, e.g. - * {@code primaryView = applyJenkins38606Fixup(views, primaryView)} + * {@code primaryView = migrateLegacyPrimaryAllViewLocalizedName(views, primaryView)} *

* NOTE: we can only fix the localized name of an {@link AllView} if it is the primary view as otherwise urls * would change, whereas the primary view is special and does not normally get accessed by the @@ -164,7 +163,7 @@ public class AllView extends View { // bingo JENKINS-38606 detected LOGGER.log(Level.INFO, "JENKINS-38606 detected for AllView in {0}; renaming view from {1} to {2}", - new Object[]{allView.owner.getUrl(), primaryView, DEFAULT_VIEW_NAME}); + new Object[] {allView.owner, primaryView, DEFAULT_VIEW_NAME}); allView.name = DEFAULT_VIEW_NAME; return DEFAULT_VIEW_NAME; } From ead38e0d23c0a7d0d9416deffe08b8738df89bb1 Mon Sep 17 00:00:00 2001 From: Alex Taylor Date: Mon, 16 Oct 2017 04:22:31 -0400 Subject: [PATCH 09/29] [JENKINS-35459] - Prevent Duplicated elements with incorrect URL when using the search on DashBoard View (#2994) [JENKINS-35459] - Prevent Duplicated elements with incorrect URL when using the search on DashBoard View --- core/src/main/java/hudson/model/ListView.java | 33 ++++++++++++++-- .../test/java/hudson/search/SearchTest.java | 39 +++++++++++++++++++ 2 files changed, 69 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/hudson/model/ListView.java b/core/src/main/java/hudson/model/ListView.java index 22d6b6b038..9fbe60b544 100644 --- a/core/src/main/java/hudson/model/ListView.java +++ b/core/src/main/java/hudson/model/ListView.java @@ -29,6 +29,8 @@ import hudson.Util; import hudson.diagnosis.OldDataMonitor; import hudson.model.Descriptor.FormException; import hudson.model.listeners.ItemListener; +import hudson.search.CollectionSearchIndex; +import hudson.search.SearchIndexBuilder; import hudson.security.ACL; import hudson.security.ACLContext; import hudson.util.CaseInsensitiveComparator; @@ -168,16 +170,24 @@ public class ListView extends View implements DirectlyModifiableView { public DescribableList> getColumns() { return columns; } - + + + public List getItems() { + return getItems(this.recurse); + } + + /** * Returns a read-only view of all {@link Job}s in this view. * + * *

* This method returns a separate copy each time to avoid * concurrent modification issue. + * @param recurse {@code false} not to recurse in ItemGroups + * true to recurse in ItemGroups */ - @Override - public List getItems() { + private List getItems(boolean recurse) { SortedSet names; List items = new ArrayList(); @@ -217,6 +227,23 @@ public class ListView extends View implements DirectlyModifiableView { return items; } + @Override + public SearchIndexBuilder makeSearchIndex() { + SearchIndexBuilder sib = new SearchIndexBuilder().addAllAnnotations(this); + sib.add(new CollectionSearchIndex() {// for jobs in the view + protected TopLevelItem get(String key) { return getItem(key); } + protected Collection all() { return getItems(); } + @Override + protected String getName(TopLevelItem o) { + // return the name instead of the display for suggestion searching + return o.getName(); + } + }); + // add the display name for each item in the search index + addDisplayNamesToSearchIndex(sib, getItems(true)); + return sib; + } + private List expand(Collection items, List allItems) { for (TopLevelItem item : items) { if (item instanceof ItemGroup) { diff --git a/test/src/test/java/hudson/search/SearchTest.java b/test/src/test/java/hudson/search/SearchTest.java index a3b64218ad..ed8f497311 100644 --- a/test/src/test/java/hudson/search/SearchTest.java +++ b/test/src/test/java/hudson/search/SearchTest.java @@ -454,4 +454,43 @@ public class SearchTest { index.suggest(term, result); return result; } + + @Issue("JENKINS-35459") + @Test + public void testProjectNameInAListView() throws Exception { + MockFolder myMockFolder = j.createFolder("folder"); + FreeStyleProject freeStyleProject = myMockFolder.createProject(FreeStyleProject.class, "myJob"); + + ListView listView = new ListView("ListView", j.jenkins); + listView.setRecurse(true); + listView.add(myMockFolder); + listView.add(freeStyleProject); + + j.jenkins.addView(listView); + j.jenkins.setPrimaryView(listView); + + assertEquals(2, j.jenkins.getPrimaryView().getAllItems().size()); + + WebClient wc = j.createWebClient(); + Page result = wc.goTo("search/suggest?query=" + freeStyleProject.getName(), "application/json"); + + assertNotNull(result); + j.assertGoodStatus(result); + + String content = result.getWebResponse().getContentAsString(); + JSONObject jsonContent = (JSONObject)JSONSerializer.toJSON(content); + assertNotNull(jsonContent); + JSONArray jsonArray = jsonContent.getJSONArray("suggestions"); + assertNotNull(jsonArray); + + assertEquals(2, jsonArray.size()); + + Page searchResult = wc.goTo("search?q=" + myMockFolder.getName() + "%2F" + freeStyleProject.getName()); + + assertNotNull(searchResult); + j.assertGoodStatus(searchResult); + + URL resultUrl = searchResult.getUrl(); + assertTrue(resultUrl.toString().equals(j.getInstance().getRootUrl() + freeStyleProject.getUrl())); + } } From 30f2dec97f5f7e72cf539d4d80a54813744a5e6d Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Mon, 16 Oct 2017 10:27:42 +0200 Subject: [PATCH 10/29] Cleanup the code integrated in #2994 --- core/src/main/java/hudson/model/ListView.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/hudson/model/ListView.java b/core/src/main/java/hudson/model/ListView.java index 9fbe60b544..ad9667f04c 100644 --- a/core/src/main/java/hudson/model/ListView.java +++ b/core/src/main/java/hudson/model/ListView.java @@ -172,11 +172,18 @@ public class ListView extends View implements DirectlyModifiableView { } - public List getItems() { + /** + * Returns a read-only view of all {@link Job}s in this view. + * + *

+ * This method returns a separate copy each time to avoid + * concurrent modification issue. + */ + @Override + public List getItems() { return getItems(this.recurse); } - /** * Returns a read-only view of all {@link Job}s in this view. * @@ -187,7 +194,7 @@ public class ListView extends View implements DirectlyModifiableView { * @param recurse {@code false} not to recurse in ItemGroups * true to recurse in ItemGroups */ - private List getItems(boolean recurse) { + private List getItems(boolean recurse) { SortedSet names; List items = new ArrayList(); From fb5234ff13fff37b935063d81f99a9082da8e24e Mon Sep 17 00:00:00 2001 From: Devin Nusbaum Date: Mon, 16 Oct 2017 09:59:25 -0400 Subject: [PATCH 11/29] [JENKINS-36282] Make link text for cc.xml?recursive consistent with View recurse option --- core/src/main/resources/hudson/model/View/builds.jelly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/hudson/model/View/builds.jelly b/core/src/main/resources/hudson/model/View/builds.jelly index 2c6b728f56..51c5eebc35 100644 --- a/core/src/main/resources/hudson/model/View/builds.jelly +++ b/core/src/main/resources/hudson/model/View/builds.jelly @@ -39,7 +39,7 @@ THE SOFTWARE.

From e80fd6148f6472dd4f7bda35b8fd4b22399ffe79 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 16 Oct 2017 14:59:51 -0400 Subject: [PATCH 12/29] [FIXED JENKINS-47455] Null safety relating to offline nodes. --- core/src/main/java/hudson/model/AbstractBuild.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/model/AbstractBuild.java b/core/src/main/java/hudson/model/AbstractBuild.java index 1f2e32bea3..5e66617e27 100644 --- a/core/src/main/java/hudson/model/AbstractBuild.java +++ b/core/src/main/java/hudson/model/AbstractBuild.java @@ -436,11 +436,19 @@ public abstract class AbstractBuild

,R extends Abs protected Lease decideWorkspace(@Nonnull Node n, WorkspaceList wsl) throws InterruptedException, IOException { String customWorkspace = getProject().getCustomWorkspace(); if (customWorkspace != null) { + FilePath rootPath = n.getRootPath(); + if (rootPath == null) { + throw new AbortException(n.getDisplayName() + " seems to be offline"); + } // we allow custom workspaces to be concurrently used between jobs. - return Lease.createDummyLease(n.getRootPath().child(getEnvironment(listener).expand(customWorkspace))); + return Lease.createDummyLease(rootPath.child(getEnvironment(listener).expand(customWorkspace))); } // TODO: this cast is indicative of abstraction problem - return wsl.allocate(n.getWorkspaceFor((TopLevelItem)getProject()), getBuild()); + FilePath ws = n.getWorkspaceFor((TopLevelItem) getProject()); + if (ws == null) { + throw new AbortException(n.getDisplayName() + " seems to be offline"); + } + return wsl.allocate(ws, getBuild()); } public Result run(@Nonnull BuildListener listener) throws Exception { From 24ede52b285e217309c2381a68394953a9105f1c Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 16 Oct 2017 16:17:55 -0400 Subject: [PATCH 13/29] Deprecating Memoizer as there is a better replacement in Java 8. --- .../java/hudson/DescriptorExtensionList.java | 13 ++++++------ core/src/main/java/hudson/ExtensionList.java | 13 ++++++------ core/src/main/java/hudson/util/Memoizer.java | 2 ++ core/src/main/java/jenkins/model/Jenkins.java | 20 ++++++------------- 4 files changed, 20 insertions(+), 28 deletions(-) diff --git a/core/src/main/java/hudson/DescriptorExtensionList.java b/core/src/main/java/hudson/DescriptorExtensionList.java index 16d96ae441..dd334db858 100644 --- a/core/src/main/java/hudson/DescriptorExtensionList.java +++ b/core/src/main/java/hudson/DescriptorExtensionList.java @@ -31,7 +31,6 @@ import jenkins.model.Jenkins; import hudson.model.ViewDescriptor; import hudson.model.Descriptor.FormException; import hudson.util.AdaptedIterator; -import hudson.util.Memoizer; import hudson.util.Iterators.FlattenIterator; import hudson.slaves.NodeDescriptor; import hudson.tasks.Publisher; @@ -41,6 +40,8 @@ import java.util.List; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Level; import java.util.logging.Logger; import java.util.concurrent.CopyOnWriteArrayList; @@ -213,14 +214,12 @@ public class DescriptorExtensionList, D extends Descrip /** * Stores manually registered Descriptor instances. Keyed by the {@link Describable} type. */ - private static final Memoizer>> legacyDescriptors = new Memoizer>>() { - public CopyOnWriteArrayList compute(Class key) { - return new CopyOnWriteArrayList(); - } - }; + @SuppressWarnings("rawtypes") + private static final Map>> legacyDescriptors = new ConcurrentHashMap<>(); + @SuppressWarnings({"unchecked", "rawtypes"}) private static > CopyOnWriteArrayList>> getLegacyDescriptors(Class type) { - return (CopyOnWriteArrayList)legacyDescriptors.get(type); + return legacyDescriptors.computeIfAbsent(type, key -> new CopyOnWriteArrayList()); } /** diff --git a/core/src/main/java/hudson/ExtensionList.java b/core/src/main/java/hudson/ExtensionList.java index f2fcab81d4..262327f05b 100644 --- a/core/src/main/java/hudson/ExtensionList.java +++ b/core/src/main/java/hudson/ExtensionList.java @@ -30,7 +30,6 @@ import jenkins.ExtensionComponentSet; import jenkins.model.Jenkins; import hudson.util.AdaptedIterator; import hudson.util.DescriptorList; -import hudson.util.Memoizer; import hudson.util.Iterators; import hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson; @@ -40,7 +39,9 @@ import java.util.Collection; import java.util.Collections; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.Vector; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CopyOnWriteArrayList; import java.util.logging.Level; import java.util.logging.Logger; @@ -395,11 +396,12 @@ public class ExtensionList extends AbstractList implements OnMaster { return create((Jenkins)hudson,type); } + @SuppressWarnings({"unchecked", "rawtypes"}) public static ExtensionList create(Jenkins jenkins, Class type) { if(type.getAnnotation(LegacyInstancesAreScopedToHudson.class)!=null) return new ExtensionList(jenkins,type); else { - return new ExtensionList(jenkins,type,staticLegacyInstances.get(type)); + return new ExtensionList(jenkins, type, staticLegacyInstances.computeIfAbsent(type, key -> new CopyOnWriteArrayList())); } } @@ -420,11 +422,8 @@ public class ExtensionList extends AbstractList implements OnMaster { /** * Places to store static-scope legacy instances. */ - private static final Memoizer staticLegacyInstances = new Memoizer() { - public CopyOnWriteArrayList compute(Class key) { - return new CopyOnWriteArrayList(); - } - }; + @SuppressWarnings("rawtypes") + private static final Map staticLegacyInstances = new ConcurrentHashMap<>(); /** * Exposed for the test harness to clear all legacy extension instances. diff --git a/core/src/main/java/hudson/util/Memoizer.java b/core/src/main/java/hudson/util/Memoizer.java index a69d608104..8e4057100b 100644 --- a/core/src/main/java/hudson/util/Memoizer.java +++ b/core/src/main/java/hudson/util/Memoizer.java @@ -34,7 +34,9 @@ import java.util.concurrent.ConcurrentHashMap; * * @author Kohsuke Kawaguchi * @since 1.281 + * @deprecated Simply use {@link ConcurrentHashMap#computeIfAbsent}. */ +@Deprecated public abstract class Memoizer { private final ConcurrentHashMap store = new ConcurrentHashMap(); diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index 291cd84ceb..a9a5b1af2d 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -158,14 +158,12 @@ import hudson.util.HudsonIsLoading; import hudson.util.HudsonIsRestarting; import hudson.util.Iterators; import hudson.util.JenkinsReloadFailed; -import hudson.util.Memoizer; import hudson.util.MultipartFormDataParser; import hudson.util.NamingThreadFactory; import hudson.util.PluginServletFilter; import hudson.util.RemotingDiagnostics; import hudson.util.RemotingDiagnostics.HeapDump; import hudson.util.TextFile; -import java.util.concurrent.TimeUnit; import hudson.util.VersionNumber; import hudson.util.XStream2; import hudson.views.DefaultMyViewsTabBar; @@ -461,20 +459,14 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve /** * All {@link ExtensionList} keyed by their {@link ExtensionList#extensionType}. */ - private transient final Memoizer extensionLists = new Memoizer() { - public ExtensionList compute(Class key) { - return ExtensionList.create(Jenkins.this,key); - } - }; + @SuppressWarnings("rawtypes") + private transient final Map extensionLists = new ConcurrentHashMap<>(); /** * All {@link DescriptorExtensionList} keyed by their {@link DescriptorExtensionList#describableType}. */ - private transient final Memoizer descriptorLists = new Memoizer() { - public DescriptorExtensionList compute(Class key) { - return DescriptorExtensionList.createDescriptorList(Jenkins.this,key); - } - }; + @SuppressWarnings("rawtypes") + private transient final Map descriptorLists = new ConcurrentHashMap<>(); /** * {@link Computer}s in this Jenkins system. Read-only. @@ -2636,7 +2628,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve */ @SuppressWarnings({"unchecked"}) public ExtensionList getExtensionList(Class extensionType) { - return extensionLists.get(extensionType); + return extensionLists.computeIfAbsent(extensionType, key -> ExtensionList.create(this, key)); } /** @@ -2657,7 +2649,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve */ @SuppressWarnings({"unchecked"}) public ,D extends Descriptor> DescriptorExtensionList getDescriptorList(Class type) { - return descriptorLists.get(type); + return descriptorLists.computeIfAbsent(type, key -> DescriptorExtensionList.createDescriptorList(this, key)); } /** From 3b90d41f58439dd41286701de0b4793deaad003a Mon Sep 17 00:00:00 2001 From: segalaj Date: Mon, 16 Oct 2017 22:42:23 +0200 Subject: [PATCH 14/29] Fix typos and link in contributing file --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2ac34e8dea..01de1fea2c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -73,7 +73,7 @@ It is a good practice is to create branches instead of pushing to master. Once your Pull Request is ready to be merged, the repository maintainers will integrate it, prepare changelogs and ensure it gets released in one of incoming Weekly releases. -There is no additinal action required from pull request authors at this point. +There is no additional action required from pull request authors at this point. ## Copyright @@ -85,7 +85,7 @@ Contributions under MIT-compatible licenses may be also rejected if they are not We **Do NOT** require pull request submitters to sign the [contributor agreement](https://wiki.jenkins.io/display/JENKINS/Copyright+on+source+code) as long as the code is licensed under MIT and merged by one of the contributors with the signed agreement. -We still encourage people to sign the contributor agreement if they intend to submit more than a few pull ruquests. +We still encourage people to sign the contributor agreement if they intend to submit more than a few pull requests. Signing is also a mandatory prerequisite for getting merge/push permissions to core repositories and for joining teams like [Jenkins Security Team](https://jenkins.io/security/#team). @@ -101,8 +101,8 @@ just submit a pull request. # Links -* [Jenkins Contribution Landing Page](https://jenkins.io/paricipate/) -* [Jenkisn IRC Channel](https://jenkins.io/chat/) +* [Jenkins Contribution Landing Page](https://jenkins.io/participate/) +* [Jenkins IRC Channel](https://jenkins.io/chat/) * [Beginners Guide To Contributing](https://wiki.jenkins.io/display/JENKINS/Beginners+Guide+to+Contributing) * [List of newbie-friendly issues in the core](https://issues.jenkins-ci.org/issues/?jql=project%20%3D%20JENKINS%20AND%20status%20in%20(Open%2C%20%22In%20Progress%22%2C%20Reopened)%20AND%20component%20%3D%20core%20AND%20labels%20in%20(newbie-friendly)) From 36ef5d51cab5fb1a5c362ccfffcd120b88779252 Mon Sep 17 00:00:00 2001 From: Devin Nusbaum Date: Mon, 16 Oct 2017 17:02:32 -0400 Subject: [PATCH 15/29] Fix JDKInstaller for downloads requiring an Oracle login --- .../main/java/hudson/tools/JDKInstaller.java | 31 +++++++- .../java/hudson/tools/JDKInstallerTest.java | 76 ------------------- 2 files changed, 28 insertions(+), 79 deletions(-) diff --git a/core/src/main/java/hudson/tools/JDKInstaller.java b/core/src/main/java/hudson/tools/JDKInstaller.java index bb316fc104..6b4eaa98a3 100644 --- a/core/src/main/java/hudson/tools/JDKInstaller.java +++ b/core/src/main/java/hudson/tools/JDKInstaller.java @@ -48,6 +48,7 @@ import net.sf.json.JsonConfig; import org.apache.commons.httpclient.Cookie; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpMethodBase; +import org.apache.commons.httpclient.URI; import org.apache.commons.httpclient.UsernamePasswordCredentials; import org.apache.commons.httpclient.auth.AuthScope; import org.apache.commons.httpclient.methods.GetMethod; @@ -476,10 +477,29 @@ public class JDKInstaller extends ToolInstaller { throw new IOException("Failed to request " + m.getURI() +" exit code="+r); if (m.getURI().getHost().equals("login.oracle.com")) { + /* Login flow: + * 1. /oaam_server/oamLoginPage.jsp: Form for username + password. Submit action is: + * 2. /oaam_server/login.do: Returns a 302 to: + * 3. /oaam_server/loginAuth.do: After 2 seconds, JS sets window.location to: + * 4. /oaam_server/authJump.do: Contains a single form with hidden inputs and JS that submits the form to: + * 5. /oam/server/dap/cred_submit: Returns a 302 to: + * 6. https://edelivery.oracle.com/osso_login_success: Returns a 302 to the download. + */ + if (m.getURI().getPath().contains("/loginAuth.do")) { // You are redirected to this page immediately after logging in. + try { + Thread.sleep(2000); // Oracle website waits 2 seconds after logging in before redirecting. + m.releaseConnection(); + m = new GetMethod(new URI(m.getURI(), "/oaam_server/authJump.do?jump=false", true).toString()); + continue; + } catch (InterruptedException x) { + throw new IOException("Interrupted while logging in", x); + } + } + LOGGER.fine("Appears to be a login page"); String resp = IOUtils.toString(m.getResponseBodyAsStream(), m.getResponseCharSet()); m.releaseConnection(); - Matcher pm = Pattern.compile("

", Pattern.DOTALL).matcher(resp); + Matcher pm = Pattern.compile("", Pattern.DOTALL).matcher(resp); if (!pm.find()) throw new IllegalStateException("Unable to find a form in the response:\n"+resp); @@ -487,6 +507,11 @@ public class JDKInstaller extends ToolInstaller { PostMethod post = new PostMethod( new URL(new URL(m.getURI().getURI()),pm.group(1)).toExternalForm()); + if (m.getURI().getPath().contains("/authJump.do")) { + m = post; + continue; + } + String u = getDescriptor().getUsername(); Secret p = getDescriptor().getPassword(); if (u==null || p==null) { @@ -498,9 +523,9 @@ public class JDKInstaller extends ToolInstaller { String n = extractAttribute(fragment,"name"); String v = extractAttribute(fragment,"value"); if (n==null || v==null) continue; - if (n.equals("ssousername")) + if (n.equals("userid")) v = u; - if (n.equals("password")) { + if (n.equals("pass")) { v = p.getPlainText(); if (authCount++ > 3) { log.hyperlink(getCredentialPageUrl(),"Your Oracle account doesn't appear valid. Please specify a valid username/password\n"); diff --git a/test/src/test/java/hudson/tools/JDKInstallerTest.java b/test/src/test/java/hudson/tools/JDKInstallerTest.java index 458f1547a0..934db79523 100644 --- a/test/src/test/java/hudson/tools/JDKInstallerTest.java +++ b/test/src/test/java/hudson/tools/JDKInstallerTest.java @@ -15,28 +15,20 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; import hudson.model.JDK; -import hudson.model.FreeStyleProject; -import hudson.model.FreeStyleBuild; import hudson.model.TaskListener; -import hudson.tasks.Shell; import hudson.util.StreamTaskListener; import hudson.tools.JDKInstaller.Platform; -import hudson.tools.JDKInstaller.CPU; import hudson.FilePath; import hudson.Functions; import hudson.Launcher.LocalLauncher; import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; import java.util.Arrays; import java.util.Properties; import java.util.logging.Logger; import org.junit.rules.TemporaryFolder; -import org.jvnet.hudson.test.Issue; import org.jvnet.hudson.test.JenkinsRule; -import org.xml.sax.SAXException; /** * @author Kohsuke Kawaguchi @@ -101,74 +93,6 @@ public class JDKInstallerTest { j.assertEqualBeans(installer, isp.installers.get(JDKInstaller.class), "id,acceptLicense"); } - /** - * Can we locate the bundles? - */ - @Test - public void locate() throws Exception { - Assume.assumeTrue("this is a really time consuming test, so only run it when we really want", Boolean.getBoolean("jenkins.testJDKInstaller")); - - retrieveUpdateCenterData(); - - JDKInstaller i = new JDKInstaller("jdk-7u3-oth-JPR", true); - StreamTaskListener listener = StreamTaskListener.fromStdout(); - i.locate(listener, Platform.LINUX, CPU.i386); - i.locate(listener, Platform.WINDOWS, CPU.amd64); - i.locate(listener, Platform.SOLARIS, CPU.Sparc); - } - - private void retrieveUpdateCenterData() throws IOException, SAXException { - j.createWebClient().goTo("/"); // make sure data is loaded - } - - /** - * Tests the auto installation. - */ - @Test - public void autoInstallation6u13() throws Exception { - doTestAutoInstallation("jdk-6u13-oth-JPR@CDS-CDS_Developer", "1.6.0_13-b03"); - } - - /** - * JDK7 is distributed as a gzip file - */ - @Test - public void autoInstallation7() throws Exception { - doTestAutoInstallation("jdk-7-oth-JPR", "1.7.0-b147"); - } - - @Test - @Issue("JENKINS-3989") - public void autoInstallation142_17() throws Exception { - doTestAutoInstallation("j2sdk-1.4.2_17-oth-JPR@CDS-CDS_Developer", "1.4.2_17-b06"); - } - - /** - * End-to-end installation test. - */ - private void doTestAutoInstallation(String id, String fullversion) throws Exception { - Assume.assumeTrue("this is a really time consuming test, so only run it when we really want", Boolean.getBoolean("jenkins.testJDKInstaller")); - - retrieveUpdateCenterData(); - - JDKInstaller installer = new JDKInstaller(id, true); - - JDK jdk = new JDK("test", tmp.getRoot().getAbsolutePath(), Arrays.asList( - new InstallSourceProperty(Arrays.asList(installer)))); - - j.jenkins.getJDKs().add(jdk); - - FreeStyleProject p = j.createFreeStyleProject(); - p.setJDK(jdk); - p.getBuildersList().add(new Shell("java -fullversion\necho $JAVA_HOME")); - FreeStyleBuild b = j.buildAndAssertSuccess(p); - @SuppressWarnings("deprecation") String log = b.getLog(); - System.out.println(log); - // make sure it runs with the JDK that just got installed - assertTrue(log.contains(fullversion)); - assertTrue(log.contains(tmp.getRoot().getAbsolutePath())); - } - /** * Fake installation on Unix. */ From af8ac036a2273a3e4771bd5804e91b3988c486ec Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 17 Oct 2017 09:07:16 -0400 Subject: [PATCH 16/29] Updated to 2.86-SNAPSHOT. --- command-launcher-plugin/pom.xml | 2 +- core/src/main/java/hudson/ClassicPluginStrategy.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/command-launcher-plugin/pom.xml b/command-launcher-plugin/pom.xml index 4367e6f6e4..9baa16699f 100644 --- a/command-launcher-plugin/pom.xml +++ b/command-launcher-plugin/pom.xml @@ -11,7 +11,7 @@ 1.0-SNAPSHOT hpi - 2.85-SNAPSHOT + 2.86-SNAPSHOT 8 Command Launcher Plugin diff --git a/core/src/main/java/hudson/ClassicPluginStrategy.java b/core/src/main/java/hudson/ClassicPluginStrategy.java index 0a274714e5..a5d56e42d6 100644 --- a/core/src/main/java/hudson/ClassicPluginStrategy.java +++ b/core/src/main/java/hudson/ClassicPluginStrategy.java @@ -426,7 +426,7 @@ public class ClassicPluginStrategy implements PluginStrategy { new DetachedPlugin("matrix-project", "1.561.*", "1.0"), new DetachedPlugin("junit", "1.577.*", "1.0"), new DetachedPlugin("bouncycastle-api", "2.16.*", "2.16.0"), - new DetachedPlugin("command-launcher", "2.85.*", "1.0-SNAPSHOT") // TODO update after split + new DetachedPlugin("command-launcher", "2.86.*", "1.0-SNAPSHOT") // TODO update after split )); /** Implicit dependencies that are known to be unnecessary and which must be cut out to prevent a dependency cycle among bundled plugins. */ From fea8f9128132565c46ab59032afd50099bb40efd Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 17 Oct 2017 09:12:45 -0400 Subject: [PATCH 17/29] =?UTF-8?q?Review=20comments=20from=20@oleg-nenashev?= =?UTF-8?q?:=20plugin=20display=20name=20change;=20CommandLanguage=20?= =?UTF-8?q?=E2=86=92=20SystemCommandLanguage.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- command-launcher-plugin/pom.xml | 6 +++--- .../main/java/hudson/slaves/CommandConnector.java | 8 ++++---- .../main/java/hudson/slaves/CommandLauncher.java | 12 ++++++------ ...andLanguage.java => SystemCommandLanguage.java} | 8 ++++---- .../java/hudson/slaves/CommandLauncher2Test.java | 14 +++++++------- 5 files changed, 24 insertions(+), 24 deletions(-) rename command-launcher-plugin/src/main/java/org/jenkinsci/plugins/command_launcher/{CommandLanguage.java => SystemCommandLanguage.java} (89%) diff --git a/command-launcher-plugin/pom.xml b/command-launcher-plugin/pom.xml index 9baa16699f..e5328db9b2 100644 --- a/command-launcher-plugin/pom.xml +++ b/command-launcher-plugin/pom.xml @@ -14,13 +14,13 @@ 2.86-SNAPSHOT 8 - Command Launcher Plugin + Command Agent Launcher Plugin Allows agents to be launched using a specified command. - https://wiki.jenkins-ci.org/display/JENKINS/Command+Launcher+Plugin + https://wiki.jenkins.io/display/JENKINS/Command+Agent+Launcher+Plugin MIT License - http://opensource.org/licenses/MIT + https://opensource.org/licenses/MIT + 2.31 test From b6abcee12ea68ff7fc578468a57c5f33629fb345 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 17 Oct 2017 14:12:54 -0400 Subject: [PATCH 19/29] Close; have not yet cut a 1.0, pending HOSTING-442. --- command-launcher-plugin/pom.xml | 52 ---- .../java/hudson/slaves/CommandConnector.java | 82 ------- .../java/hudson/slaves/CommandLauncher.java | 226 ------------------ .../SystemCommandLanguage.java | 55 ----- .../slaves/CommandConnector/config.jelly | 30 --- .../CommandConnector/config_bg.properties | 24 -- .../CommandConnector/config_de.properties | 23 -- .../CommandConnector/config_es.properties | 23 -- .../CommandConnector/config_ja.properties | 23 -- .../CommandConnector/config_pt_BR.properties | 23 -- .../CommandConnector/config_sr.properties | 3 - .../CommandConnector/config_zh_TW.properties | 23 -- .../slaves/CommandLauncher/config.jelly | 30 --- .../CommandLauncher/config_bg.properties | 24 -- .../CommandLauncher/config_da.properties | 23 -- .../CommandLauncher/config_de.properties | 23 -- .../CommandLauncher/config_es.properties | 23 -- .../CommandLauncher/config_fr.properties | 23 -- .../CommandLauncher/config_ja.properties | 23 -- .../CommandLauncher/config_pt_BR.properties | 23 -- .../CommandLauncher/config_ru.properties | 23 -- .../CommandLauncher/config_sr.properties | 3 - .../CommandLauncher/config_sv_SE.properties | 23 -- .../CommandLauncher/config_tr.properties | 23 -- .../CommandLauncher/config_zh_TW.properties | 23 -- .../slaves/CommandLauncher/help-command.html | 36 --- .../CommandLauncher/help-command_bg.html | 36 --- .../CommandLauncher/help-command_fr.html | 55 ----- .../CommandLauncher/help-command_ja.html | 34 --- .../CommandLauncher/help-command_ru.html | 39 --- .../hudson/slaves/CommandLauncher/help.jelly | 28 --- .../slaves/CommandLauncher/help.properties | 24 -- .../slaves/CommandLauncher/help_bg.properties | 28 --- .../slaves/CommandLauncher/help_de.properties | 24 -- .../slaves/CommandLauncher/help_es.properties | 25 -- .../slaves/CommandLauncher/help_sr.properties | 3 - .../src/main/resources/index.jelly | 4 - .../command_launcher/Messages.properties | 26 -- .../command_launcher/Messages_bg.properties | 6 - .../command_launcher/Messages_da.properties | 1 - .../command_launcher/Messages_de.properties | 4 - .../command_launcher/Messages_es.properties | 3 - .../command_launcher/Messages_fr.properties | 1 - .../command_launcher/Messages_ja.properties | 1 - .../command_launcher/Messages_lt.properties | 2 - .../Messages_pt_BR.properties | 1 - .../command_launcher/Messages_sr.properties | 4 - .../Messages_zh_TW.properties | 1 - .../hudson/slaves/CommandConnectorTest.java | 36 --- .../hudson/slaves/CommandLauncher2Test.java | 190 --------------- .../hudson/slaves/CommandLauncherTest.java | 97 -------- .../ancientSerialForm/config.xml | 21 -- pom.xml | 1 - war/pom.xml | 4 +- 54 files changed, 1 insertion(+), 1608 deletions(-) delete mode 100644 command-launcher-plugin/pom.xml delete mode 100644 command-launcher-plugin/src/main/java/hudson/slaves/CommandConnector.java delete mode 100644 command-launcher-plugin/src/main/java/hudson/slaves/CommandLauncher.java delete mode 100644 command-launcher-plugin/src/main/java/org/jenkinsci/plugins/command_launcher/SystemCommandLanguage.java delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config.jelly delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_bg.properties delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_de.properties delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_es.properties delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_ja.properties delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_pt_BR.properties delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_sr.properties delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_zh_TW.properties delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config.jelly delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_bg.properties delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_da.properties delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_de.properties delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_es.properties delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_fr.properties delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_ja.properties delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_pt_BR.properties delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_ru.properties delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_sr.properties delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_sv_SE.properties delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_tr.properties delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_zh_TW.properties delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command.html delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_bg.html delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_fr.html delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_ja.html delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_ru.html delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help.jelly delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help.properties delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_bg.properties delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_de.properties delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_es.properties delete mode 100644 command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_sr.properties delete mode 100644 command-launcher-plugin/src/main/resources/index.jelly delete mode 100644 command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages.properties delete mode 100644 command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_bg.properties delete mode 100644 command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_da.properties delete mode 100644 command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_de.properties delete mode 100644 command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_es.properties delete mode 100644 command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_fr.properties delete mode 100644 command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_ja.properties delete mode 100644 command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_lt.properties delete mode 100644 command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_pt_BR.properties delete mode 100644 command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_sr.properties delete mode 100644 command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_zh_TW.properties delete mode 100644 command-launcher-plugin/src/test/java/hudson/slaves/CommandConnectorTest.java delete mode 100644 command-launcher-plugin/src/test/java/hudson/slaves/CommandLauncher2Test.java delete mode 100644 command-launcher-plugin/src/test/java/hudson/slaves/CommandLauncherTest.java delete mode 100644 command-launcher-plugin/src/test/resources/hudson/slaves/CommandLauncher2Test/ancientSerialForm/config.xml diff --git a/command-launcher-plugin/pom.xml b/command-launcher-plugin/pom.xml deleted file mode 100644 index e5328db9b2..0000000000 --- a/command-launcher-plugin/pom.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - 4.0.0 - - org.jenkins-ci.plugins - plugin - 2.34 - - - command-launcher - 1.0-SNAPSHOT - hpi - - 2.86-SNAPSHOT - 8 - - Command Agent Launcher Plugin - Allows agents to be launched using a specified command. - https://wiki.jenkins.io/display/JENKINS/Command+Agent+Launcher+Plugin - - - MIT License - https://opensource.org/licenses/MIT - - - - - - repo.jenkins-ci.org - https://repo.jenkins-ci.org/public/ - - - - - repo.jenkins-ci.org - https://repo.jenkins-ci.org/public/ - - - - - org.jenkins-ci.plugins - script-security - 1.18.1 - - - diff --git a/command-launcher-plugin/src/main/java/hudson/slaves/CommandConnector.java b/command-launcher-plugin/src/main/java/hudson/slaves/CommandConnector.java deleted file mode 100644 index bed124122d..0000000000 --- a/command-launcher-plugin/src/main/java/hudson/slaves/CommandConnector.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * The MIT License - * - * Copyright (c) 2010, InfraDNA, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package hudson.slaves; - -import hudson.EnvVars; -import hudson.Extension; -import hudson.Util; -import hudson.model.TaskListener; -import hudson.util.FormValidation; -import java.io.IOException; -import org.jenkinsci.Symbol; -import org.jenkinsci.plugins.command_launcher.Messages; -import org.jenkinsci.plugins.command_launcher.SystemCommandLanguage; -import org.jenkinsci.plugins.scriptsecurity.scripts.ApprovalContext; -import org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval; -import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.QueryParameter; - -/** - * Executes a program on the master and expect that script to connect. - * - * @author Kohsuke Kawaguchi - */ -public class CommandConnector extends ComputerConnector { - public final String command; - - @DataBoundConstructor - public CommandConnector(String command) { - this.command = command; - // TODO add withKey if we can determine the Cloud.name being configured - ScriptApproval.get().configuring(command, SystemCommandLanguage.get(), ApprovalContext.create().withCurrentUser()); - } - - private Object readResolve() { - ScriptApproval.get().configuring(command, SystemCommandLanguage.get(), ApprovalContext.create()); - return this; - } - - @Override - public CommandLauncher launch(String host, TaskListener listener) throws IOException, InterruptedException { - // no need to call ScriptApproval.using here; CommandLauncher.launch will do that - return new CommandLauncher(new EnvVars("SLAVE", host), command); - } - - @Extension @Symbol("command") - public static class DescriptorImpl extends ComputerConnectorDescriptor { - @Override - public String getDisplayName() { - return Messages.CommandLauncher_displayName(); - } - - public FormValidation doCheckCommand(@QueryParameter String value) { - if (Util.fixEmptyAndTrim(value) == null) { - return FormValidation.error(Messages.CommandLauncher_NoLaunchCommand()); - } else { - return ScriptApproval.get().checking(value, SystemCommandLanguage.get()); - } - } - - } -} diff --git a/command-launcher-plugin/src/main/java/hudson/slaves/CommandLauncher.java b/command-launcher-plugin/src/main/java/hudson/slaves/CommandLauncher.java deleted file mode 100644 index be363b66d1..0000000000 --- a/command-launcher-plugin/src/main/java/hudson/slaves/CommandLauncher.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * The MIT License - * - * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Stephen Connolly - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package hudson.slaves; - -import hudson.AbortException; -import hudson.EnvVars; -import hudson.Util; -import hudson.Extension; -import hudson.Functions; -import hudson.model.Descriptor; -import hudson.model.Slave; -import jenkins.model.Jenkins; -import hudson.model.TaskListener; -import hudson.remoting.Channel; -import hudson.util.StreamCopyThread; -import hudson.util.FormValidation; -import hudson.util.ProcessTree; - -import java.io.IOException; -import java.util.Date; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.apache.commons.lang.StringUtils; -import org.jenkinsci.Symbol; -import org.jenkinsci.plugins.command_launcher.SystemCommandLanguage; -import org.jenkinsci.plugins.scriptsecurity.scripts.ApprovalContext; -import org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval; -import org.jenkinsci.plugins.scriptsecurity.scripts.UnapprovedUsageException; -import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.QueryParameter; - -/** - * {@link ComputerLauncher} through a remote login mechanism like ssh/rsh. - * - * @author Stephen Connolly - * @author Kohsuke Kawaguchi -*/ -public class CommandLauncher extends ComputerLauncher { - - /** - * Command line to launch the agent, like - * "ssh myslave java -jar /path/to/hudson-remoting.jar" - */ - private final String agentCommand; - - /** - * Optional environment variables to add to the current environment. Can be null. - */ - private final EnvVars env; - - /** Constructor for use from UI. Conditionally approves the script. */ - @DataBoundConstructor - public CommandLauncher(String command) { - agentCommand = command; - env = null; - // TODO add withKey if we can determine the Slave.nodeName being configured - ScriptApproval.get().configuring(command, SystemCommandLanguage.get(), ApprovalContext.create().withCurrentUser()); - } - - /** Constructor for programmatic use. Always approves the script. */ - public CommandLauncher(String command, EnvVars env) { - this.agentCommand = command; - this.env = env; - ScriptApproval.get().preapprove(command, SystemCommandLanguage.get()); - } - - /** Constructor for use from {@link CommandConnector}. Never approves the script. */ - CommandLauncher(EnvVars env, String command) { - this.agentCommand = command; - this.env = env; - } - - private Object readResolve() { - ScriptApproval.get().configuring(agentCommand, SystemCommandLanguage.get(), ApprovalContext.create()); - return this; - } - - public String getCommand() { - return agentCommand; - } - - /** - * Gets the formatted current time stamp. - */ - private static String getTimestamp() { - return String.format("[%1$tD %1$tT]", new Date()); - } - - @Override - public void launch(SlaveComputer computer, final TaskListener listener) { - EnvVars _cookie = null; - Process _proc = null; - try { - Slave node = computer.getNode(); - if (node == null) { - throw new AbortException("Cannot launch commands on deleted nodes"); - } - - listener.getLogger().println(org.jenkinsci.plugins.command_launcher.Messages.Slave_Launching(getTimestamp())); - String command = ScriptApproval.get().using(getCommand(), SystemCommandLanguage.get()); - if (command.trim().length() == 0) { - listener.getLogger().println(org.jenkinsci.plugins.command_launcher.Messages.CommandLauncher_NoLaunchCommand()); - return; - } - listener.getLogger().println("$ " + command); - - ProcessBuilder pb = new ProcessBuilder(Util.tokenize(command)); - final EnvVars cookie = _cookie = EnvVars.createCookie(); - pb.environment().putAll(cookie); - pb.environment().put("WORKSPACE", StringUtils.defaultString(computer.getAbsoluteRemoteFs(), node.getRemoteFS())); //path for local slave log - - {// system defined variables - String rootUrl = Jenkins.getInstance().getRootUrl(); - if (rootUrl!=null) { - pb.environment().put("HUDSON_URL", rootUrl); // for backward compatibility - pb.environment().put("JENKINS_URL", rootUrl); - pb.environment().put("SLAVEJAR_URL", rootUrl+"/jnlpJars/agent.jar"); - pb.environment().put("AGENTJAR_URL", rootUrl+"/jnlpJars/agent.jar"); - } - } - - if (env != null) { - pb.environment().putAll(env); - } - - final Process proc = _proc = pb.start(); - - // capture error information from stderr. this will terminate itself - // when the process is killed. - new StreamCopyThread("stderr copier for remote agent on " + computer.getDisplayName(), - proc.getErrorStream(), listener.getLogger()).start(); - - computer.setChannel(proc.getInputStream(), proc.getOutputStream(), listener.getLogger(), new Channel.Listener() { - @Override - public void onClosed(Channel channel, IOException cause) { - reportProcessTerminated(proc, listener); - - try { - ProcessTree.get().killAll(proc, cookie); - } catch (InterruptedException e) { - LOGGER.log(Level.INFO, "interrupted", e); - } - } - }); - - LOGGER.info("agent launched for " + computer.getDisplayName()); - } catch (InterruptedException e) { - Functions.printStackTrace(e, listener.error(Messages.ComputerLauncher_abortedLaunch())); - } catch (UnapprovedUsageException e) { - listener.error(e.getMessage()); - } catch (RuntimeException e) { - Functions.printStackTrace(e, listener.error(Messages.ComputerLauncher_unexpectedError())); - } catch (Error e) { - Functions.printStackTrace(e, listener.error(Messages.ComputerLauncher_unexpectedError())); - } catch (IOException e) { - Util.displayIOException(e, listener); - - String msg = Util.getWin32ErrorMessage(e); - if (msg == null) { - msg = ""; - } else { - msg = " : " + msg; - // FIXME TODO i18n what is this!? - } - msg = org.jenkinsci.plugins.command_launcher.Messages.Slave_UnableToLaunch(computer.getDisplayName(), msg); - LOGGER.log(Level.SEVERE, msg, e); - Functions.printStackTrace(e, listener.error(msg)); - - if(_proc!=null) { - reportProcessTerminated(_proc, listener); - try { - ProcessTree.get().killAll(_proc, _cookie); - } catch (InterruptedException x) { - Functions.printStackTrace(x, listener.error(Messages.ComputerLauncher_abortedLaunch())); - } - } - } - } - - private static void reportProcessTerminated(Process proc, TaskListener listener) { - try { - int exitCode = proc.exitValue(); - listener.error("Process terminated with exit code " + exitCode); - } catch (IllegalThreadStateException e) { - // hasn't terminated yet - } - } - - private static final Logger LOGGER = Logger.getLogger(CommandLauncher.class.getName()); - - @Extension @Symbol("command") - public static class DescriptorImpl extends Descriptor { - public String getDisplayName() { - return org.jenkinsci.plugins.command_launcher.Messages.CommandLauncher_displayName(); - } - - public FormValidation doCheckCommand(@QueryParameter String value) { - if(Util.fixEmptyAndTrim(value)==null) - return FormValidation.error(org.jenkinsci.plugins.command_launcher.Messages.CommandLauncher_NoLaunchCommand()); - else - return ScriptApproval.get().checking(value, SystemCommandLanguage.get()); - } - } -} diff --git a/command-launcher-plugin/src/main/java/org/jenkinsci/plugins/command_launcher/SystemCommandLanguage.java b/command-launcher-plugin/src/main/java/org/jenkinsci/plugins/command_launcher/SystemCommandLanguage.java deleted file mode 100644 index 625d27b14c..0000000000 --- a/command-launcher-plugin/src/main/java/org/jenkinsci/plugins/command_launcher/SystemCommandLanguage.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * The MIT License - * - * Copyright 2017 CloudBees, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package org.jenkinsci.plugins.command_launcher; - -import hudson.Extension; -import hudson.ExtensionList; -import hudson.Util; -import org.jenkinsci.plugins.scriptsecurity.scripts.Language; -import org.kohsuke.accmod.Restricted; -import org.kohsuke.accmod.restrictions.NoExternalUse; - -/** - * Language for launched processes, as per {@link Util#tokenize(String)} and {@link ProcessBuilder}. - */ -@Restricted(NoExternalUse.class) // TODO move to script-security after split -@Extension -public class SystemCommandLanguage extends Language { - - public static Language get() { - return ExtensionList.lookup(Language.class).get(SystemCommandLanguage.class); - } - - @Override - public String getName() { - return "system-command"; - } - - @Override - public String getDisplayName() { - return "System Commands"; - } - -} diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config.jelly b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config.jelly deleted file mode 100644 index 37b017955d..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config.jelly +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_bg.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_bg.properties deleted file mode 100644 index ee97be0e93..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_bg.properties +++ /dev/null @@ -1,24 +0,0 @@ -# The MIT License -# -# Bulgarian translation: Copyright (c) 2016, Alexander Shopov -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -Launch\ command=\ - \u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430 \u0441\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u043d\u0435 diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_de.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_de.properties deleted file mode 100644 index 903a1a1512..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_de.properties +++ /dev/null @@ -1,23 +0,0 @@ -# The MIT License -# -# Copyright (c) 2004-, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributers -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -Launch\ command=Startkommando diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_es.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_es.properties deleted file mode 100644 index f2c1318370..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_es.properties +++ /dev/null @@ -1,23 +0,0 @@ -# The MIT License -# -# Copyright (c) 2004-, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributers -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -Launch\ command=Comando a ejecutar para lanzar la tarea diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_ja.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_ja.properties deleted file mode 100644 index 86996d9a86..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_ja.properties +++ /dev/null @@ -1,23 +0,0 @@ -# The MIT License -# -# Copyright (c) 2012, Seiji Sogabe -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -Launch\ command=\u8d77\u52d5\u30b3\u30de\u30f3\u30c9 diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_pt_BR.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_pt_BR.properties deleted file mode 100644 index 397b9ea131..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_pt_BR.properties +++ /dev/null @@ -1,23 +0,0 @@ -# The MIT License -# -# Copyright (c) 2004-, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributers -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -Launch\ command=Comando de lan\u00e7amento diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_sr.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_sr.properties deleted file mode 100644 index 67a16da6ab..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_sr.properties +++ /dev/null @@ -1,3 +0,0 @@ -# This file is under the MIT License by authors - -Launch\ command=\u0418\u0437\u0432\u0440\u0448\u0438 \u043F\u0440\u043E\u0433\u0440\u0430\u043C \ No newline at end of file diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_zh_TW.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_zh_TW.properties deleted file mode 100644 index 4827b2c10b..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandConnector/config_zh_TW.properties +++ /dev/null @@ -1,23 +0,0 @@ -# The MIT License -# -# Copyright (c) 2013, Chunghwa Telecom Co., Ltd., Pei-Tang Huang -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -Launch\ command=\u555f\u52d5\u6307\u4ee4 diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config.jelly b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config.jelly deleted file mode 100644 index 37b017955d..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config.jelly +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_bg.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_bg.properties deleted file mode 100644 index ee97be0e93..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_bg.properties +++ /dev/null @@ -1,24 +0,0 @@ -# The MIT License -# -# Bulgarian translation: Copyright (c) 2016, Alexander Shopov -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -Launch\ command=\ - \u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430 \u0441\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u043d\u0435 diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_da.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_da.properties deleted file mode 100644 index 841cac3361..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_da.properties +++ /dev/null @@ -1,23 +0,0 @@ -# The MIT License -# -# Copyright (c) 2004-2010, Sun Microsystems, Inc. Kohsuke Kawaguchi. Knud Poulsen. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -Launch\ command=Opstartskommando diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_de.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_de.properties deleted file mode 100644 index 80a74d2cc3..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_de.properties +++ /dev/null @@ -1,23 +0,0 @@ -# The MIT License -# -# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Simon Wiest -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -Launch\ command=Startkommando diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_es.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_es.properties deleted file mode 100644 index 1976127bf0..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_es.properties +++ /dev/null @@ -1,23 +0,0 @@ -# The MIT License -# -# Copyright (c) 2004-2010, Sun Microsystems, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -Launch\ command=Comando para iniciar la ejecución diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_fr.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_fr.properties deleted file mode 100644 index 8a80348a9f..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_fr.properties +++ /dev/null @@ -1,23 +0,0 @@ -# The MIT License -# -# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Eric Lefevre-Ardant -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -Launch\ command=Commande de lancement diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_ja.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_ja.properties deleted file mode 100644 index a75df75423..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_ja.properties +++ /dev/null @@ -1,23 +0,0 @@ -# The MIT License -# -# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -Launch\ command=\u8d77\u52d5\u30b3\u30de\u30f3\u30c9 diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_pt_BR.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_pt_BR.properties deleted file mode 100644 index 6554a4c42b..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_pt_BR.properties +++ /dev/null @@ -1,23 +0,0 @@ -# The MIT License -# -# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Reginaldo L. Russinholi, Cleiber Silva -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -Launch\ command=Executar comando diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_ru.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_ru.properties deleted file mode 100644 index a0bc405b48..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_ru.properties +++ /dev/null @@ -1,23 +0,0 @@ -# The MIT License -# -# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Mike Salnikov -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -Launch\ command=\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_sr.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_sr.properties deleted file mode 100644 index f7053d115b..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_sr.properties +++ /dev/null @@ -1,3 +0,0 @@ -# This file is under the MIT License by authors - -Launch\ command=\u041A\u043E\u043C\u0430\u043D\u0434\u0430 \u0437\u0430 \u043F\u043E\u043A\u0440\u0435\u0442\u0430\u045A\u0435 diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_sv_SE.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_sv_SE.properties deleted file mode 100644 index 78f777b97d..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_sv_SE.properties +++ /dev/null @@ -1,23 +0,0 @@ -# The MIT License -# -# Copyright (c) 2004-2010, Sun Microsystems, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -Launch\ command=Startkommando diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_tr.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_tr.properties deleted file mode 100644 index 151ee806c4..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_tr.properties +++ /dev/null @@ -1,23 +0,0 @@ -# The MIT License -# -# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Oguz Dag -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -Launch\ command=komutu \u00e7al\u0131\u015ft\u0131r diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_zh_TW.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_zh_TW.properties deleted file mode 100644 index 4827b2c10b..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/config_zh_TW.properties +++ /dev/null @@ -1,23 +0,0 @@ -# The MIT License -# -# Copyright (c) 2013, Chunghwa Telecom Co., Ltd., Pei-Tang Huang -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -Launch\ command=\u555f\u52d5\u6307\u4ee4 diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command.html b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command.html deleted file mode 100644 index 4602953b05..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command.html +++ /dev/null @@ -1,36 +0,0 @@ -
- Command to be used to launch an agent program, which controls the agent - computer and communicates with the master. Jenkins assumes that - the executed program launches the agent.jar program on the correct - machine. - -

- A copy of agent.jar can be downloaded from here. - -

- In a simple case, this could be - something like "ssh hostname java -jar ~/bin/agent.jar". - - However, it is often a good idea to write a small shell script, like the following, on an agent - so that you can control the location of Java and/or agent.jar, as well as set up any - environment variables specific to this node, such as PATH. - -

-#!/bin/sh
-exec java -jar ~/bin/agent.jar
-
- -

- You can use any command to run a process on the agent machine, such as RSH, - as long as stdin/stdout of this process will be connected to - "java -jar ~/bin/agent.jar" eventually. - -

- In a larger deployment, it is also worth considering to load agent.jar from - a NFS-mounted common location, so that you don't have to update this file every time - you update Jenkins. - -

- Setting this to "ssh -v hostname" may be useful for debugging connectivity - issue. -

diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_bg.html b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_bg.html deleted file mode 100644 index e1429361b2..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_bg.html +++ /dev/null @@ -1,36 +0,0 @@ -
- Команда за стартирането на агента, който управлява компютъра и комуникира - с управляващия компютър. Jenkins приема, че изпълнената програма ще - стартира agent.jar на правилната машина. - -

- Може да изтеглите agent.jar - оттук. - -

- В най-простия случай, това може да е команда като тази: - „ssh hostname java -jar ~/bin/agent.jar“. - - Често е по-добре да напишете малък скрипт подобен на този отдолу, за да може да - настройвате местоположението на Java и/или agent.jar, както и да променяте - променливите на средата на машината, например „PATH“: - -

-#!/bin/sh
-exec java -jar ~/bin/agent.jar
-
- -

- Може да използвате произволна команда за стартирането на процеса на управляваната - машина, стига тя да е в състояние да изпълни „java -jar ~/bin/agent.jar“ като - остане свързана със стандартните вход и изход на този процес. - -

- При по-големи инсталации може да зареждате agent.jar от споделен монтиран - ресурс, например NFS, така че да не се налага ръчно да обновявате файла при всяко - обновяване на Jenkins. - -

- Ако имате проблеми със свързаността, може да ги изчистите по-лесно като зададете - командата да е „ssh -v hostname“. -

diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_fr.html b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_fr.html deleted file mode 100644 index d155bb47ee..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_fr.html +++ /dev/null @@ -1,55 +0,0 @@ -
- La commande à utiliser pour lancer un agent esclave, qui contrôle la - machine-esclave et communique avec la machine-maître. - -

Les agents esclaves JNLP

-

- Laissez ce champ vide si vous souhaitez lancer les esclaves par JNLP. - Avec cette configuration, la page d'information sur les esclaves - (jenkins/computer/***/) aura une icône de lancement JNLP. Vous pouvez - cliquer sur ce lien pour lancer un agent esclave par JNLP. -

- Ce mode est utile pour les esclaves Windows qui n'ont généralement pas - de mécanisme d'exécution à distance. - -

Les agents esclaves ssh/rsh

-

- Quand une commande est spécifiée dans ce champ, elle est exécutée - sur le maître et Jenkins suppose que le programme exécuté lance le - programme agent.jar sur la bonne machine esclave. - -

- Une copie du agent.jar peut être téléchargée - ici. - -

- Pour un cas simple, cette commande pourrait être du type - "ssh hostname java -jar ~/bin/agent.jar". - - Cela dit, il est généralement préférable d'écrire un petit script sur - l'esclave, comme celui qui suit, afin de gérer le répertoire - d'installation de Java et/ou de agent.jar. Vous pouvez aussi - positionner des variables d'environnement spécifiques à cette machine - esclave, comme le PATH. - -

-#!/bin/sh
-exec java -jar ~/bin/agent.jar
-
- -

- Vous pouvez utiliser n'importe quelle commande d'exécution d'un - process sur la machine-esclave, comme RSH, du moment que les - sorties stdin/stdout de ce process sont au final connectées - sur "java -jar ~/bin/agent.jar". - -

- Dans un déploiement à plus grande échelle, on peut envisager de charger - agent.jar à partir d'une location commune montée par NFS, afin - de ne pas nécessiter la mise à jour de ce fichier à chaque mise à jour - de Jenkins. - -

- Mettre la valeur "ssh -v hostname" dans ce champ peut être - utile pour débugger les problèmes de connexion. -

diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_ja.html b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_ja.html deleted file mode 100644 index f097c28a9d..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_ja.html +++ /dev/null @@ -1,34 +0,0 @@ -
- スレーブエージェントとプログラムの起動に使用するコマンドで、スレーブのコンピュータの制御、 - マスターとの通信を行います。 - -

- この項目にコマンドが指定されたとき、マスターでこのコマンドが実行されます。そして、 - Jenkinsは、その実行コマンドが正しいスレーブマシーン上でagent.jarを起動することを想定しています。 - -

- agent.jarのコピーが、jenkins.warの中のWEB-INF/agent.jarにあります。 - -

- シンプルなケースでは、このコマンドは"ssh hostname java -jar ~/bin/agent.jar"のようなものになります。 - - しかし、PATHのようなこのスレーブノード独自の環境変数を設定するのと同時に、javaやagent.jarの場所を制御できるように、 - スレーブに以下のような小さいシェルスクリプトを書くのはいい考えです。 - -

-#!/bin/sh
-exec java -jar ~/bin/agent.jar
-
- -

- RSHのようなスレーブマシンでプロセスを起動できるようなコマンドを使用することができます。 - ただし、プロセスの標準入出力が"java -jar ~/bin/agent.jar"を接続している必要があります。 - -

- スレーブがたくさん配置されている場合、NFSでマウントされた共通の場所から、 - agent.jarをロードすることは考える価値があります。 - そうすれば、Jenkinsを更新するごとにこのファイルを更新する必要がありません。 - -

- "ssh -v ホスト名"とすると、接続確認するのに便利です。 -

diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_ru.html b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_ru.html deleted file mode 100644 index 91d49385cb..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help-command_ru.html +++ /dev/null @@ -1,39 +0,0 @@ -
- Команда, которая будет использована для запуска программы-агента на подчиненном узле. Эта - программа необходима для контроля подчиненного узла и обмена данными с мастером. - -

- Когда в этом поле указана команда, она будет выполнена на мастере и Jenkins предполагает - что эта команда запустит agent.jar на соответствующем подчиненном узле. - -

- Копию файла agent.jar вы можете загрузить по этой ссылке. - -

- В самом простом случае команда будет выглядеть приблизительно так: - "ssh hostname java -jar ~/bin/agent.jar" - - Однако, обычно лучшей идеей будет написание простого shell скрипта, содержащего - указанную команду, чтобы вам было удобнее контролировать путь к java и/или agent.jar, - равно как и устанавливать любые переменные окружения, специфичные для конкретного узла, - например, такие как PATH. - -

-#!/bin/sh
-exec java -jar ~/bin/agent.jar
-
- -

- Вы можете использовать любую команду для запуска процесса на подчиненном узле, - такую как RSH, главное - чтобы стандартный вывод и ввод этого процесса был связан - с "java -jar ~/bin/agent.jar". - -

- Для построения систем с большим количеством подчиненных узлов может быть полезно - загружать agent.jar из замонтированного по NFS общего источника, так чтобы - вам не пришлось обновлять все узлы при обновлении Jenkins. - -

- Установите в качестве команды "ssh -v hostname" для проверки и определения - проблем при установке соединения. -

diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help.jelly b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help.jelly deleted file mode 100644 index f326f7fa28..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help.jelly +++ /dev/null @@ -1,28 +0,0 @@ - - - - - ${%blurb} - \ No newline at end of file diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help.properties deleted file mode 100644 index ea17495f1d..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help.properties +++ /dev/null @@ -1,24 +0,0 @@ -# The MIT License -# -# Copyright (c) 2004-2009, Sun Microsystems, Inc., Seiji Sogabe -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -blurb=Starts an agent by having Jenkins execute a command from the master. \ - Use this when the master is capable of remotely executing a process on another machine, e.g. via SSH or RSH. diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_bg.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_bg.properties deleted file mode 100644 index 8efdbd543b..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_bg.properties +++ /dev/null @@ -1,28 +0,0 @@ -# The MIT License -# -# Bulgarian translation: Copyright (c) 2016, Alexander Shopov -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -# Starts an agent by having Jenkins execute a command from the master. \ -# Use this when the master is capable of remotely executing a process on another machine, e.g. via SSH or RSH. -blurb=\ - \u0421\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u043d\u0435 \u043d\u0430 \u0430\u0433\u0435\u043d\u0442 \u043a\u0430\u0442\u043e Jenkins \u0438\u0437\u043f\u044a\u043b\u043d\u044f\u0432\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043e\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0432\u0430\u0449\u0438\u044f \u043a\u043e\u043c\u043f\u044e\u0442\u044a\u0440.\ - \u041f\u043e\u043b\u0437\u0432\u0430\u0439\u0442\u0435 \u0442\u043e\u0437\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043a\u043e\u0433\u0430\u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0432\u0430\u0449\u0438\u044f\u0442 \u043a\u043e\u043c\u043f\u044e\u0442\u044a\u0440 \u043c\u043e\u0436\u0435 \u0434\u0430 \u0438\u0437\u043f\u044a\u043b\u043d\u044f\u0432\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0438\ - \u043d\u0430 \u0434\u0440\u0443\u0433\u0438 \u043c\u0430\u0448\u0438\u043d\u0438, \u043d\u0430\u043f\u0440. \u0447\u0440\u0435\u0437 SSH \u0438\u043b\u0438 RSH. diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_de.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_de.properties deleted file mode 100644 index 0093fdac95..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_de.properties +++ /dev/null @@ -1,24 +0,0 @@ -# The MIT License -# -# Copyright (c) 2017 Daniel Beck and a number of other of contributors -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -blurb=Startet einen Agenten durch Ausf\u00FChrung eines Befehls auf dem Master-Knoten. \ - Verwenden Sie diese Methode, wenn der Master-Knoten einen Prozess auf einem anderen System, z.B. via SSH oder RSH, ausf\u00FChren kann. diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_es.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_es.properties deleted file mode 100644 index e56b6a0ab4..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_es.properties +++ /dev/null @@ -1,25 +0,0 @@ -# The MIT License -# -# Copyright (c) 2004-2009, Sun Microsystems, Inc., Seiji Sogabe -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -blurb=Arranca un nodo secundario ejecutando un commando desde el principal.\ - Utiliza esta opción cuando el nodo principal sea capaz de ejecutar comandos remotos en el secundario (ssh/rsh). - diff --git a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_sr.properties b/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_sr.properties deleted file mode 100644 index 1f0dde0773..0000000000 --- a/command-launcher-plugin/src/main/resources/hudson/slaves/CommandLauncher/help_sr.properties +++ /dev/null @@ -1,3 +0,0 @@ -# This file is under the MIT License by authors - -blurb=\u041F\u043E\u043A\u0440\u0435\u043D\u0435 \u0430\u0433\u0435\u043D\u0442\u0430 \u0442\u0430\u043A\u043E \u0448\u0442\u043E Jenkins \u0438\u0437\u0432\u0440\u0448\u0438 \u043A\u043E\u043C\u0430\u043D\u0434\u0443 \u0441\u0430 \u0433\u043B\u0430\u0432\u043D\u0435 \u043C\u0430\u0448\u0438\u043D\u0435. \u041A\u043E\u0440\u0438\u0441\u0442\u0438\u0442\u0435 \u043E\u0432\u0443 \u043E\u043F\u0446\u0438\u0458\u0443 \u043A\u0430\u0434 \u0433\u043E\u0434 \u0433\u043B\u0430\u0432\u043D\u0430 \u043C\u0430\u0448\u0438\u043D\u0430 \u0458\u0435 \u0443 \u0441\u0442\u0430\u045A\u0443 \u0434\u0430 \u0438\u0437\u0432\u0440\u0448\u0438 \u043F\u0440\u043E\u0446\u0435\u0441 \u043D\u0430 \u0434\u0440\u0443\u0433\u043E\u0458 \u043C\u0430\u0448\u0438\u043D\u0438, \u043D\u043F\u0440. \u043F\u0440\u0435\u043A\u043E SSH \u0438\u043B\u0438 RSH. diff --git a/command-launcher-plugin/src/main/resources/index.jelly b/command-launcher-plugin/src/main/resources/index.jelly deleted file mode 100644 index 257eb16b8f..0000000000 --- a/command-launcher-plugin/src/main/resources/index.jelly +++ /dev/null @@ -1,4 +0,0 @@ - -
- Allows agents to be launched using a specified command. -
diff --git a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages.properties b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages.properties deleted file mode 100644 index 2790853798..0000000000 --- a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages.properties +++ /dev/null @@ -1,26 +0,0 @@ -# The MIT License -# -# Copyright 2017 CloudBees, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -Slave.Launching={0} Launching agent -CommandLauncher.NoLaunchCommand=No launch command specified -CommandLauncher.displayName=Launch agent via execution of command on the master -Slave.UnableToLaunch=Unable to launch the agent for {0}{1} diff --git a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_bg.properties b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_bg.properties deleted file mode 100644 index d8498302b3..0000000000 --- a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_bg.properties +++ /dev/null @@ -1,6 +0,0 @@ -CommandLauncher.NoLaunchCommand=\ - \u041d\u0435 \u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430 \u0441\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u043d\u0435. -CommandLauncher.displayName=\ - \u0421\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u043d\u0435 \u043d\u0430 \u0430\u0433\u0435\u043d\u0442 \u0447\u0440\u0435\u0437 \u0441\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u043d\u0435 \u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u044e\u0442\u044a\u0440 -Slave.UnableToLaunch=\ - \u0410\u0433\u0435\u043d\u0442\u044a\u0442 \u0437\u0430 {0}{1} \u043d\u0435 \u043c\u043e\u0436\u0435 \u0434\u0430 \u0441\u0435 \u0441\u0442\u0430\u0440\u0442\u0438\u0440\u0430 diff --git a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_da.properties b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_da.properties deleted file mode 100644 index 128e8976df..0000000000 --- a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_da.properties +++ /dev/null @@ -1 +0,0 @@ -CommandLauncher.NoLaunchCommand=Ingen opstartskommando givet diff --git a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_de.properties b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_de.properties deleted file mode 100644 index da38fe9129..0000000000 --- a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_de.properties +++ /dev/null @@ -1,4 +0,0 @@ -Slave.Launching=Starte Agenten -CommandLauncher.NoLaunchCommand=Kein Startkommando angegeben. -CommandLauncher.displayName=Agent durch Ausf\u00FChrung eines Befehls auf dem Master-Knoten starten -Slave.UnableToLaunch=Kann Agent \u201E{0}\u201C nicht starten{1} diff --git a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_es.properties b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_es.properties deleted file mode 100644 index 648acd84f8..0000000000 --- a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_es.properties +++ /dev/null @@ -1,3 +0,0 @@ -Slave.Launching={0} Arrancando el agente -CommandLauncher.NoLaunchCommand=No se ha especificado ningún comando -Slave.UnableToLaunch=Imposible ejecutar el agente en {0}{1} diff --git a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_fr.properties b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_fr.properties deleted file mode 100644 index 2dcfbc4fa5..0000000000 --- a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_fr.properties +++ /dev/null @@ -1 +0,0 @@ -CommandLauncher.NoLaunchCommand=Aucune commande de lancement sp\u00e9cifi\u00e9e diff --git a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_ja.properties b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_ja.properties deleted file mode 100644 index 6917e336a9..0000000000 --- a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_ja.properties +++ /dev/null @@ -1 +0,0 @@ -CommandLauncher.NoLaunchCommand=\u8d77\u52d5\u30b3\u30de\u30f3\u30c9\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002 diff --git a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_lt.properties b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_lt.properties deleted file mode 100644 index ebbe25751b..0000000000 --- a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_lt.properties +++ /dev/null @@ -1,2 +0,0 @@ -Slave.Launching={0} Paleid\u017eiamas agentas -Slave.UnableToLaunch=Nepavyksta paleisti agento skirto {0}{1} diff --git a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_pt_BR.properties b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_pt_BR.properties deleted file mode 100644 index e48bbf8e9f..0000000000 --- a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_pt_BR.properties +++ /dev/null @@ -1 +0,0 @@ -CommandLauncher.NoLaunchCommand=Sem nenhum comando de lan\u00e7amento especificado diff --git a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_sr.properties b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_sr.properties deleted file mode 100644 index 0815fdadb3..0000000000 --- a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_sr.properties +++ /dev/null @@ -1,4 +0,0 @@ -Slave.Launching={0} \u043F\u043E\u043A\u0440\u0435\u0442\u0430\u045A\u0435 \u0430\u0433\u0435\u043D\u0442\u043E\u043C -CommandLauncher.NoLaunchCommand=\u041D\u0438\u0458\u0435 \u043D\u0430\u0432\u0435\u0434\u0435\u043D\u043E \u043A\u043E\u043C\u0430\u043D\u0434\u0430 \u0437\u0430 \u043F\u043E\u043A\u0440\u0435\u0442\u0430\u045A\u0435. -CommandLauncher.displayName=\u041F\u043E\u043A\u0440\u0435\u043D\u0438 \u0430\u0433\u0435\u043D\u0442\u0430 \u0438\u0437\u0432\u0440\u0448\u0430\u0432\u0430\u045A\u0443 \u043A\u043E\u043C\u0430\u043D\u0434\u0435 \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u043E\u0458 \u043C\u0430\u0448\u0438\u043D\u0438 -Slave.UnableToLaunch=\u0410\u0433\u0435\u043D\u0430\u0442 \u0437\u0430 {0}{1} \u043D\u0435 \u043C\u043E\u0436\u0435 \u0434\u0430 \u0441\u0435 \u043F\u043E\u043A\u0440\u0435\u043D\u0435 diff --git a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_zh_TW.properties b/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_zh_TW.properties deleted file mode 100644 index 644a9967ee..0000000000 --- a/command-launcher-plugin/src/main/resources/org/jenkinsci/plugins/command_launcher/Messages_zh_TW.properties +++ /dev/null @@ -1 +0,0 @@ -CommandLauncher.NoLaunchCommand=\u6c92\u6709\u6307\u5b9a\u555f\u52d5\u6307\u4ee4 diff --git a/command-launcher-plugin/src/test/java/hudson/slaves/CommandConnectorTest.java b/command-launcher-plugin/src/test/java/hudson/slaves/CommandConnectorTest.java deleted file mode 100644 index 78ef369a6c..0000000000 --- a/command-launcher-plugin/src/test/java/hudson/slaves/CommandConnectorTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * The MIT License - * - * Copyright (c) 2010, InfraDNA, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package hudson.slaves; - -import org.jvnet.hudson.test.HudsonTestCase; - -/** - * @author Kohsuke Kawaguchi - */ -public class CommandConnectorTest extends HudsonTestCase { - public void testConfigRoundtrip() throws Exception { - CommandConnector cc = new CommandConnector("abc def"); - assertEqualDataBoundBeans(cc,configRoundtrip(cc)); - } -} diff --git a/command-launcher-plugin/src/test/java/hudson/slaves/CommandLauncher2Test.java b/command-launcher-plugin/src/test/java/hudson/slaves/CommandLauncher2Test.java deleted file mode 100644 index c97b28c2b6..0000000000 --- a/command-launcher-plugin/src/test/java/hudson/slaves/CommandLauncher2Test.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * The MIT License - * - * Copyright 2017 CloudBees, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package hudson.slaves; - -import com.gargoylesoftware.htmlunit.HttpMethod; -import com.gargoylesoftware.htmlunit.WebRequest; -import com.gargoylesoftware.htmlunit.html.HtmlForm; -import com.gargoylesoftware.htmlunit.html.HtmlTextInput; -import hudson.XmlFile; -import hudson.cli.CLICommand; -import hudson.cli.CLICommandInvoker; -import hudson.cli.UpdateNodeCommand; -import hudson.model.Computer; -import hudson.model.User; -import java.io.File; -import java.io.IOException; -import java.util.Collections; -import java.util.Set; -import javax.annotation.CheckForNull; -import jenkins.model.Jenkins; -import org.apache.tools.ant.filters.StringInputStream; -import static org.hamcrest.Matchers.*; -import org.jenkinsci.plugins.command_launcher.SystemCommandLanguage; -import org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval; -import static org.junit.Assert.*; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runners.model.Statement; -import org.jvnet.hudson.test.Issue; -import org.jvnet.hudson.test.JenkinsRule; -import org.jvnet.hudson.test.MockAuthorizationStrategy; -import org.jvnet.hudson.test.RestartableJenkinsRule; -import org.jvnet.hudson.test.recipes.LocalData; - -public class CommandLauncher2Test { - - @Rule - public RestartableJenkinsRule rr = new RestartableJenkinsRule(); - - @Issue("SECURITY-478") - @Test - public void requireApproval() throws Exception { - rr.addStep(new Statement() { // TODO .then, when using sufficiently new jenkins-test-harness - @Override - public void evaluate() throws Throwable { - rr.j.jenkins.setSecurityRealm(rr.j.createDummySecurityRealm()); - rr.j.jenkins.setAuthorizationStrategy(new MockAuthorizationStrategy(). - grant(Jenkins.ADMINISTER).everywhere().to("admin"). - grant(Jenkins.READ, Computer.CONFIGURE).everywhere().to("dev")); - ScriptApproval.get().preapprove("echo unconfigured", SystemCommandLanguage.get()); - DumbSlave s = new DumbSlave("s", "/", new CommandLauncher("echo unconfigured")); - rr.j.jenkins.addNode(s); - // First, reconfigure using GUI. - JenkinsRule.WebClient wc = rr.j.createWebClient().login("admin"); - HtmlForm form = wc.getPage(s, "configure").getFormByName("config"); - HtmlTextInput input = form.getInputByName("_.command"); - assertEquals("echo unconfigured", input.getText()); - input.setText("echo configured by GUI"); - rr.j.submit(form); - s = (DumbSlave) rr.j.jenkins.getNode("s"); - assertEquals("echo configured by GUI", ((CommandLauncher) s.getLauncher()).getCommand()); - assertSerialForm(s, "echo configured by GUI"); - // Then by REST. - String configDotXml = s.toComputer().getUrl() + "config.xml"; - String xml = wc.goTo(configDotXml, "application/xml").getWebResponse().getContentAsString(); - assertThat(xml, containsString("echo configured by GUI")); - WebRequest req = new WebRequest(wc.createCrumbedUrl(configDotXml), HttpMethod.POST); - req.setEncodingType(null); - req.setRequestBody(xml.replace("echo configured by GUI", "echo configured by REST")); - wc.getPage(req); - s = (DumbSlave) rr.j.jenkins.getNode("s"); - assertEquals("echo configured by REST", ((CommandLauncher) s.getLauncher()).getCommand()); - assertSerialForm(s, "echo configured by REST"); - // Then by CLI. - CLICommand cmd = new UpdateNodeCommand(); - cmd.setTransportAuth(User.get("admin").impersonate()); - assertThat(new CLICommandInvoker(rr.j, cmd).withStdin(new StringInputStream(xml.replace("echo configured by GUI", "echo configured by CLI"))).invokeWithArgs("s"), CLICommandInvoker.Matcher.succeededSilently()); - s = (DumbSlave) rr.j.jenkins.getNode("s"); - assertEquals("echo configured by CLI", ((CommandLauncher) s.getLauncher()).getCommand()); - assertEquals(Collections.emptySet(), ScriptApproval.get().getPendingScripts()); - assertSerialForm(s, "echo configured by CLI"); - // Now verify that all modes failed as dev. First as GUI. - ScriptApproval.get().preapprove("echo configured by admin", SystemCommandLanguage.get()); - s.setLauncher(new CommandLauncher("echo configured by admin")); - s.save(); - wc = rr.j.createWebClient().login("dev"); - form = wc.getPage(s, "configure").getFormByName("config"); - input = form.getInputByName("_.command"); - assertEquals("echo configured by admin", input.getText()); - input.setText("echo GUI ATTACK"); - rr.j.submit(form); - s = (DumbSlave) rr.j.jenkins.getNode("s"); - assertEquals("echo GUI ATTACK", ((CommandLauncher) s.getLauncher()).getCommand()); - Set pendingScripts = ScriptApproval.get().getPendingScripts(); - assertEquals(1, pendingScripts.size()); - ScriptApproval.PendingScript pendingScript = pendingScripts.iterator().next(); - assertEquals(SystemCommandLanguage.get(), pendingScript.getLanguage()); - assertEquals("echo GUI ATTACK", pendingScript.script); - assertEquals("dev", pendingScript.getContext().getUser()); - ScriptApproval.get().denyScript(pendingScript.getHash()); - assertSerialForm(s, "echo GUI ATTACK"); - // Then by REST. - req = new WebRequest(wc.createCrumbedUrl(configDotXml), HttpMethod.POST); - req.setEncodingType(null); - req.setRequestBody(xml.replace("echo configured by GUI", "echo REST ATTACK")); - wc.getPage(req); - s = (DumbSlave) rr.j.jenkins.getNode("s"); - assertEquals("echo REST ATTACK", ((CommandLauncher) s.getLauncher()).getCommand()); - pendingScripts = ScriptApproval.get().getPendingScripts(); - assertEquals(1, pendingScripts.size()); - pendingScript = pendingScripts.iterator().next(); - assertEquals(SystemCommandLanguage.get(), pendingScript.getLanguage()); - assertEquals("echo REST ATTACK", pendingScript.script); - assertEquals(/* deserialization, not recording user */ null, pendingScript.getContext().getUser()); - ScriptApproval.get().denyScript(pendingScript.getHash()); - assertSerialForm(s, "echo REST ATTACK"); - // Then by CLI. - cmd = new UpdateNodeCommand(); - cmd.setTransportAuth(User.get("dev").impersonate()); - assertThat(new CLICommandInvoker(rr.j, cmd).withStdin(new StringInputStream(xml.replace("echo configured by GUI", "echo CLI ATTACK"))).invokeWithArgs("s"), CLICommandInvoker.Matcher.succeededSilently()); - s = (DumbSlave) rr.j.jenkins.getNode("s"); - assertEquals("echo CLI ATTACK", ((CommandLauncher) s.getLauncher()).getCommand()); - pendingScripts = ScriptApproval.get().getPendingScripts(); - assertEquals(1, pendingScripts.size()); - pendingScript = pendingScripts.iterator().next(); - assertEquals(SystemCommandLanguage.get(), pendingScript.getLanguage()); - assertEquals("echo CLI ATTACK", pendingScript.script); - assertEquals(/* ditto */null, pendingScript.getContext().getUser()); - ScriptApproval.get().denyScript(pendingScript.getHash()); - assertSerialForm(s, "echo CLI ATTACK"); - // Now also check that SYSTEM deserialization works after a restart. - } - private void assertSerialForm(DumbSlave s, @CheckForNull String expectedCommand) throws IOException { - // cf. private methods in Nodes - File nodesDir = new File(rr.j.jenkins.getRootDir(), "nodes"); - XmlFile configXml = new XmlFile(Jenkins.XSTREAM, new File(new File(nodesDir, s.getNodeName()), "config.xml")); - assertThat(configXml.asString(), expectedCommand != null ? containsString("" + expectedCommand + "") : not(containsString(""))); - } - }); - rr.addStep(new Statement() { - @Override - public void evaluate() throws Throwable { - DumbSlave s = (DumbSlave) rr.j.jenkins.getNode("s"); - assertEquals("echo CLI ATTACK", ((CommandLauncher) s.getLauncher()).getCommand()); - Set pendingScripts = ScriptApproval.get().getPendingScripts(); - assertEquals(1, pendingScripts.size()); - ScriptApproval.PendingScript pendingScript = pendingScripts.iterator().next(); - assertEquals(SystemCommandLanguage.get(), pendingScript.getLanguage()); - assertEquals("echo CLI ATTACK", pendingScript.script); - assertEquals(/* ditto */null, pendingScript.getContext().getUser()); - } - }); - } - - @LocalData // saved by Hudson 1.215 - @Test - public void ancientSerialForm() { - rr.addStep(new Statement() { - @Override - public void evaluate() throws Throwable { - ComputerLauncher launcher = ((DumbSlave) rr.j.jenkins.getNode("test")).getLauncher(); - assertThat(launcher, instanceOf(CommandLauncher.class)); - assertEquals("echo from CLI", ((CommandLauncher) launcher).getCommand()); - } - }); - } - -} diff --git a/command-launcher-plugin/src/test/java/hudson/slaves/CommandLauncherTest.java b/command-launcher-plugin/src/test/java/hudson/slaves/CommandLauncherTest.java deleted file mode 100644 index 4800def882..0000000000 --- a/command-launcher-plugin/src/test/java/hudson/slaves/CommandLauncherTest.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * The MIT License - * - * Copyright (c) 2015 Red Hat, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package hudson.slaves; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.not; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import static org.junit.Assume.assumeTrue; -import hudson.Functions; -import hudson.model.Node; - -import java.util.Collections; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; - -import org.junit.Rule; -import org.junit.Test; -import org.jvnet.hudson.test.JenkinsRule; - -public class CommandLauncherTest { - - @Rule - public JenkinsRule j = new JenkinsRule(); - - @Test - // TODO sometimes gets EOFException as in commandSucceedsWithoutChannel - public void commandFails() throws Exception { - assumeTrue(!Functions.isWindows()); - DumbSlave slave = createSlave("false"); - - String log = slave.toComputer().getLog(); - assertTrue(log, slave.toComputer().isOffline()); - assertThat(log, containsString("ERROR: Process terminated with exit code")); - assertThat(log, not(containsString("ERROR: Process terminated with exit code 0"))); - } - - // TODO Sometimes gets `EOFException: unexpected stream termination` before then on CI builder; maybe needs to wait in a loop for a message to appear? - @Test - public void commandSucceedsWithoutChannel() throws Exception { - assumeTrue(!Functions.isWindows()); - DumbSlave slave = createSlave("true"); - - String log = slave.toComputer().getLog(); - assertTrue(log, slave.toComputer().isOffline()); - assertThat(log, containsString("ERROR: Process terminated with exit code 0")); - } - - public DumbSlave createSlave(String command) throws Exception { - DumbSlave slave; - synchronized (j.jenkins) { // TODO this lock smells like a bug post 1.607 - slave = new DumbSlave( - "dummy", - "dummy", - j.createTmpDir().getPath(), - "1", - Node.Mode.NORMAL, - "", - new CommandLauncher(command), - RetentionStrategy.NOOP, - Collections.EMPTY_LIST - ); - j.jenkins.addNode(slave); - } - - try { - slave.toComputer().connect(false).get(1, TimeUnit.SECONDS); - fail("the slave was not supposed to connect successfully"); - } catch (ExecutionException e) { - // ignore, we just want to - } - - return slave; - } -} diff --git a/command-launcher-plugin/src/test/resources/hudson/slaves/CommandLauncher2Test/ancientSerialForm/config.xml b/command-launcher-plugin/src/test/resources/hudson/slaves/CommandLauncher2Test/ancientSerialForm/config.xml deleted file mode 100644 index ae8a30d973..0000000000 --- a/command-launcher-plugin/src/test/resources/hudson/slaves/CommandLauncher2Test/ancientSerialForm/config.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - 2 - - - - - - test - - /tmp - 1 - NORMAL - echo from CLI - - - - 5 - 0 - ede47f10a483fb5bcc4ffe063a7890b847c31baffcecb124305738bc0d969b3d - \ No newline at end of file diff --git a/pom.xml b/pom.xml index 68bdf6aec7..931d8758d1 100644 --- a/pom.xml +++ b/pom.xml @@ -49,7 +49,6 @@ THE SOFTWARE. core - command-launcher-plugin war test cli diff --git a/war/pom.xml b/war/pom.xml index 5433c7720b..19e3183728 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -404,14 +404,12 @@ THE SOFTWARE. 2.16.0 hpi - hpi - --> ${project.build.directory}/${project.build.finalName}/WEB-INF/detached-plugins true From 417afd66f3c5ab346aecdc9aaeac4bcaaa284ec1 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Tue, 17 Oct 2017 15:30:29 -0400 Subject: [PATCH 20/29] 1.0 released. --- core/src/main/java/hudson/ClassicPluginStrategy.java | 2 +- war/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/ClassicPluginStrategy.java b/core/src/main/java/hudson/ClassicPluginStrategy.java index a5d56e42d6..b53ac9978f 100644 --- a/core/src/main/java/hudson/ClassicPluginStrategy.java +++ b/core/src/main/java/hudson/ClassicPluginStrategy.java @@ -426,7 +426,7 @@ public class ClassicPluginStrategy implements PluginStrategy { new DetachedPlugin("matrix-project", "1.561.*", "1.0"), new DetachedPlugin("junit", "1.577.*", "1.0"), new DetachedPlugin("bouncycastle-api", "2.16.*", "2.16.0"), - new DetachedPlugin("command-launcher", "2.86.*", "1.0-SNAPSHOT") // TODO update after split + new DetachedPlugin("command-launcher", "2.86.*", "1.0") )); /** Implicit dependencies that are known to be unnecessary and which must be cut out to prevent a dependency cycle among bundled plugins. */ diff --git a/war/pom.xml b/war/pom.xml index 19e3183728..f5338c7310 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -407,7 +407,7 @@ THE SOFTWARE. org.jenkins-ci.plugins command-launcher - 1.0-20171017.180336-1 + 1.0 hpi From 815b97a907b470a605b540fee37cdb22809a5b45 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 18 Oct 2017 12:21:00 -0400 Subject: [PATCH 21/29] Updating JnlpAccessWithSecuredHudsonTest to JenkinsRule. --- .../bugs/JnlpAccessWithSecuredHudsonTest.java | 86 +++++++++++-------- 1 file changed, 48 insertions(+), 38 deletions(-) diff --git a/test/src/test/java/hudson/bugs/JnlpAccessWithSecuredHudsonTest.java b/test/src/test/java/hudson/bugs/JnlpAccessWithSecuredHudsonTest.java index 5ba3d079de..8c970e8cc9 100644 --- a/test/src/test/java/hudson/bugs/JnlpAccessWithSecuredHudsonTest.java +++ b/test/src/test/java/hudson/bugs/JnlpAccessWithSecuredHudsonTest.java @@ -26,22 +26,22 @@ package hudson.bugs; import com.gargoylesoftware.htmlunit.Page; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.xml.XmlPage; +import hudson.Functions; +import hudson.Proc; import hudson.cli.util.ScriptLoader; import hudson.model.Node.Mode; import hudson.model.Slave; import hudson.remoting.Channel; -import hudson.remoting.Launcher; -import hudson.remoting.Which; import hudson.slaves.JNLPLauncher; import hudson.slaves.RetentionStrategy; import hudson.slaves.DumbSlave; +import hudson.util.StreamTaskListener; import jenkins.security.MasterToSlaveCallable; import jenkins.security.s2m.AdminWhitelistRule; import org.dom4j.Document; import org.dom4j.Element; import org.dom4j.io.DOMReader; import org.jvnet.hudson.test.Email; -import org.jvnet.hudson.test.HudsonTestCase; import org.jvnet.hudson.test.recipes.PresetData; import org.jvnet.hudson.test.recipes.PresetData.DataSet; @@ -51,14 +51,27 @@ import java.net.URL; import java.util.Collections; import java.util.List; import java.util.Locale; +import org.apache.commons.io.FileUtils; import org.apache.tools.ant.util.JavaEnvUtils; +import static org.hamcrest.Matchers.*; +import static org.junit.Assert.*; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; +import org.jvnet.hudson.test.JenkinsRule; /** * Makes sure that the jars that web start needs are readable, even when the anonymous user doesn't have any read access. * * @author Kohsuke Kawaguchi */ -public class JnlpAccessWithSecuredHudsonTest extends HudsonTestCase { +public class JnlpAccessWithSecuredHudsonTest { + + @Rule + public JenkinsRule r = new JenkinsRule(); + + @Rule + public TemporaryFolder tmp = new TemporaryFolder(); /** * Creates a new slave that needs to be launched via JNLP. @@ -69,13 +82,14 @@ public class JnlpAccessWithSecuredHudsonTest extends HudsonTestCase { @PresetData(DataSet.NO_ANONYMOUS_READACCESS) @Email("http://markmail.org/message/on4wkjdaldwi2atx") - public void testAnonymousCanAlwaysLoadJARs() throws Exception { - jenkins.setNodes(Collections.singletonList(createNewJnlpSlave("test"))); - HudsonTestCase.WebClient wc = new WebClient(); + @Test + public void anonymousCanAlwaysLoadJARs() throws Exception { + r.jenkins.setNodes(Collections.singletonList(createNewJnlpSlave("test"))); + JenkinsRule.WebClient wc = r.createWebClient(); HtmlPage p = wc.login("alice").goTo("computer/test/"); // this fresh WebClient doesn't have a login cookie and represent JNLP launcher - HudsonTestCase.WebClient jnlpAgent = new WebClient(); + JenkinsRule.WebClient jnlpAgent = r.createWebClient(); // parse the JNLP page into DOM to list up the jars. XmlPage jnlp = (XmlPage) wc.goTo("computer/test/slave-agent.jnlp","application/x-java-jnlp-file"); @@ -92,47 +106,43 @@ public class JnlpAccessWithSecuredHudsonTest extends HudsonTestCase { } @PresetData(DataSet.ANONYMOUS_READONLY) - public void testAnonymousCannotGetSecrets() throws Exception { - jenkins.setNodes(Collections.singletonList(createNewJnlpSlave("test"))); - new WebClient().assertFails("computer/test/slave-agent.jnlp", HttpURLConnection.HTTP_FORBIDDEN); + @Test + public void anonymousCannotGetSecrets() throws Exception { + r.jenkins.setNodes(Collections.singletonList(createNewJnlpSlave("test"))); + r.createWebClient().assertFails("computer/test/slave-agent.jnlp", HttpURLConnection.HTTP_FORBIDDEN); } @PresetData(DataSet.NO_ANONYMOUS_READACCESS) @SuppressWarnings("SleepWhileInLoop") - public void testServiceUsingDirectSecret() throws Exception { + @Test + public void serviceUsingDirectSecret() throws Exception { Slave slave = createNewJnlpSlave("test"); - jenkins.setNodes(Collections.singletonList(slave)); - new WebClient().goTo("computer/test/slave-agent.jnlp?encrypt=true", "application/octet-stream"); + r.jenkins.setNodes(Collections.singletonList(slave)); + r.createWebClient().goTo("computer/test/slave-agent.jnlp?encrypt=true", "application/octet-stream"); String secret = slave.getComputer().getJnlpMac(); // To watch it fail: secret = secret.replace('1', '2'); - ProcessBuilder pb = new ProcessBuilder(JavaEnvUtils.getJreExecutable("java"), "-jar", Which.jarFile(Launcher.class).getAbsolutePath(), "-jnlpUrl", getURL() + "computer/test/slave-agent.jnlp", "-secret", secret); - - pb = pb.inheritIO(); - - System.err.println("Running: " + pb.command()); - Process p = pb.start(); + File slaveJar = tmp.newFile(); + FileUtils.copyURLToFile(new Slave.JnlpJar("slave.jar").getURL(), slaveJar); + Proc p = new hudson.Launcher.LocalLauncher(StreamTaskListener.fromStderr()).launch(). + stdout(System.out).stderr(System.err). + cmds(JavaEnvUtils.getJreExecutable("java"), "-jar", slaveJar.getAbsolutePath(), "-jnlpUrl", r.getURL() + "computer/test/slave-agent.jnlp", "-secret", secret). + start(); try { - for (int i = 0; i < /* one minute */600; i++) { - if (slave.getComputer().isOnline()) { - System.err.println("JNLP slave successfully connected"); - Channel channel = slave.getComputer().getChannel(); - assertFalse("SECURITY-206", channel.isRemoteClassLoadingAllowed()); - jenkins.getExtensionList(AdminWhitelistRule.class).get(AdminWhitelistRule.class).setMasterKillSwitch(false); - final File f = new File(jenkins.getRootDir(), "config.xml"); - assertTrue(f.exists()); - try { - fail("SECURITY-206: " + channel.call(new Attack(f.getAbsolutePath()))); - } catch (SecurityException x) { - System.out.println("expected: " + x); - assertTrue(x.getMessage().contains("https://jenkins.io/redirect/security-144")); - } - return; - } + while (!slave.toComputer().isOnline()) { // TODO can use r.waitOnline(slave) after https://github.com/jenkinsci/jenkins-test-harness/pull/80 Thread.sleep(100); } - fail("JNLP slave agent failed to connect"); + Channel channel = slave.getComputer().getChannel(); + assertFalse("SECURITY-206", channel.isRemoteClassLoadingAllowed()); + r.jenkins.getExtensionList(AdminWhitelistRule.class).get(AdminWhitelistRule.class).setMasterKillSwitch(false); + final File f = new File(r.jenkins.getRootDir(), "config.xml"); + assertTrue(f.exists()); + try { + fail("SECURITY-206: " + channel.call(new Attack(f.getAbsolutePath()))); + } catch (SecurityException x) { + assertThat(Functions.printThrowable(x), containsString("https://jenkins.io/redirect/security-144")); + } } finally { - p.destroy(); + p.kill(); } } From 3defe0f8aafb00423b56265f3ab0fcfd80dfb972 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 18 Oct 2017 15:02:22 -0400 Subject: [PATCH 22/29] QueueTest.taskEquality was flaky: the original task could run before we got a chance to even try scheduling a second. --- test/src/test/java/hudson/model/QueueTest.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/src/test/java/hudson/model/QueueTest.java b/test/src/test/java/hudson/model/QueueTest.java index 516bb4677a..3c5d120a3b 100644 --- a/test/src/test/java/hudson/model/QueueTest.java +++ b/test/src/test/java/hudson/model/QueueTest.java @@ -118,10 +118,12 @@ import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicInteger; +import java.util.logging.Level; import static org.hamcrest.Matchers.nullValue; import static org.junit.Assert.*; import org.junit.Ignore; +import org.jvnet.hudson.test.LoggerRule; /** * @author Kohsuke Kawaguchi @@ -130,6 +132,9 @@ public class QueueTest { @Rule public JenkinsRule r = new NodeProvisionerRule(-1, 0, 10); + @Rule + public LoggerRule logging = new LoggerRule().record(Queue.class, Level.FINE); + /** * Checks the persistence of queue. */ @@ -520,17 +525,19 @@ public class QueueTest { @Test public void taskEquality() throws Exception { AtomicInteger cnt = new AtomicInteger(); - ScheduleResult result = r.jenkins.getQueue().schedule2(new TestTask(cnt), 0); + TestTask originalTask = new TestTask(cnt, true); + ScheduleResult result = r.jenkins.getQueue().schedule2(originalTask, 0); assertTrue(result.isCreated()); WaitingItem item = result.getCreateItem(); assertFalse(r.jenkins.getQueue().schedule2(new TestTask(cnt), 0).isCreated()); + originalTask.isBlocked = false; item.getFuture().get(); r.waitUntilNoActivity(); assertEquals(1, cnt.get()); } static class TestTask implements Queue.Task { private final AtomicInteger cnt; - private final boolean isBlocked; + boolean isBlocked; TestTask(AtomicInteger cnt) { this(cnt, false); From 0e5274b4b5fdd4dd6751d9c2186ca0c2c83932be Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 18 Oct 2017 22:07:59 -0400 Subject: [PATCH 23/29] [JENKINS-47517] Revert the change to the default behavior of Queue.Task.getCauseOfBlockage. --- core/src/main/java/hudson/model/Queue.java | 3 --- test/src/test/java/hudson/model/QueueTest.java | 14 -------------- 2 files changed, 17 deletions(-) diff --git a/core/src/main/java/hudson/model/Queue.java b/core/src/main/java/hudson/model/Queue.java index 3ea6e8dacf..214213c488 100644 --- a/core/src/main/java/hudson/model/Queue.java +++ b/core/src/main/java/hudson/model/Queue.java @@ -1841,9 +1841,6 @@ public class Queue extends ResourceController implements Saveable { */ @CheckForNull default CauseOfBlockage getCauseOfBlockage() { - if (isBuildBlocked()) { - return CauseOfBlockage.fromMessage(Messages._Queue_Unknown()); - } return null; } diff --git a/test/src/test/java/hudson/model/QueueTest.java b/test/src/test/java/hudson/model/QueueTest.java index 516bb4677a..1518b404ab 100644 --- a/test/src/test/java/hudson/model/QueueTest.java +++ b/test/src/test/java/hudson/model/QueueTest.java @@ -988,20 +988,6 @@ public class QueueTest { } } - @Test - public void testDefaultImplementationOfGetCauseOfBlockageForBlocked() throws Exception { - Queue queue = r.getInstance().getQueue(); - queue.schedule2(new TestTask(new AtomicInteger(0), true), 0); - - queue.maintain(); - - assertEquals(1, r.jenkins.getQueue().getBlockedItems().size()); - CauseOfBlockage actual = r.jenkins.getQueue().getBlockedItems().get(0).getCauseOfBlockage(); - CauseOfBlockage expected = CauseOfBlockage.fromMessage(Messages._Queue_Unknown()); - - assertEquals(expected.getShortDescription(), actual.getShortDescription()); - } - @Test public void testGetCauseOfBlockageForNonConcurrentFreestyle() throws Exception { Queue queue = r.getInstance().getQueue(); From 19714f201809cf1bb4e278e53bc58eafef23d36f Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Thu, 19 Oct 2017 13:06:35 -0400 Subject: [PATCH 24/29] Deprecate isBuildBlocked & getWhyBlocked in favor of getCauseOfBlockage, which you needed to implement anyway. --- .../java/hudson/model/AbstractProject.java | 26 ++---- core/src/main/java/hudson/model/Queue.java | 14 ++-- .../hudson/model/queue/QueueTaskFilter.java | 2 + .../model/queue/AbstractQueueTaskTest.java | 83 +++++++++++++++++++ .../src/test/java/hudson/model/QueueTest.java | 3 +- 5 files changed, 103 insertions(+), 25 deletions(-) create mode 100644 core/src/test/java/hudson/model/queue/AbstractQueueTaskTest.java diff --git a/core/src/main/java/hudson/model/AbstractProject.java b/core/src/main/java/hudson/model/AbstractProject.java index 954011f650..ffee6413d8 100644 --- a/core/src/main/java/hudson/model/AbstractProject.java +++ b/core/src/main/java/hudson/model/AbstractProject.java @@ -1015,24 +1015,6 @@ public abstract class AbstractProject

,R extends A return this; // in this way, any member that wants to run with the main guy can nominate the project itself } - /** - * {@inheritDoc} - * - *

- * A project must be blocked if its own previous build is in progress, - * or if the blockBuildWhenUpstreamBuilding option is true and an upstream - * project is building, but derived classes can also check other conditions. - */ - @Override - public boolean isBuildBlocked() { - return getCauseOfBlockage()!=null; - } - - public String getWhyBlocked() { - CauseOfBlockage cb = getCauseOfBlockage(); - return cb!=null ? cb.getShortDescription() : null; - } - /** * @deprecated use {@link BlockedBecauseOfBuildInProgress} instead. */ @@ -1075,6 +1057,14 @@ public abstract class AbstractProject

,R extends A } } + /** + * {@inheritDoc} + * + *

+ * A project must be blocked if its own previous build is in progress, + * or if the blockBuildWhenUpstreamBuilding option is true and an upstream + * project is building, but derived classes can also check other conditions. + */ @Override public CauseOfBlockage getCauseOfBlockage() { // Block builds until they are done with post-production diff --git a/core/src/main/java/hudson/model/Queue.java b/core/src/main/java/hudson/model/Queue.java index 214213c488..ece3da76cf 100644 --- a/core/src/main/java/hudson/model/Queue.java +++ b/core/src/main/java/hudson/model/Queue.java @@ -1814,18 +1814,22 @@ public class Queue extends ResourceController implements Saveable { /** * Returns true if the execution should be blocked * for temporary reasons. - * - *

- * Short-hand for {@code getCauseOfBlockageForItem()!=null}. + * @deprecated Use {@link #getCauseOfBlockage} != null */ - boolean isBuildBlocked(); + @Deprecated + default boolean isBuildBlocked() { + return getCauseOfBlockage() != null; + } /** * @deprecated as of 1.330 * Use {@link CauseOfBlockage#getShortDescription()} instead. */ @Deprecated - String getWhyBlocked(); + default String getWhyBlocked() { + CauseOfBlockage cause = getCauseOfBlockage(); + return cause != null ? cause.getShortDescription() : null; + } /** * If the execution of this task should be blocked for temporary reasons, diff --git a/core/src/main/java/hudson/model/queue/QueueTaskFilter.java b/core/src/main/java/hudson/model/queue/QueueTaskFilter.java index 4688551b8e..9bf4887247 100644 --- a/core/src/main/java/hudson/model/queue/QueueTaskFilter.java +++ b/core/src/main/java/hudson/model/queue/QueueTaskFilter.java @@ -56,10 +56,12 @@ public abstract class QueueTaskFilter implements Queue.Task { return base.getLastBuiltOn(); } + @Deprecated public boolean isBuildBlocked() { return base.isBuildBlocked(); } + @Deprecated public String getWhyBlocked() { return base.getWhyBlocked(); } diff --git a/core/src/test/java/hudson/model/queue/AbstractQueueTaskTest.java b/core/src/test/java/hudson/model/queue/AbstractQueueTaskTest.java new file mode 100644 index 0000000000..9a31d139c3 --- /dev/null +++ b/core/src/test/java/hudson/model/queue/AbstractQueueTaskTest.java @@ -0,0 +1,83 @@ +/* + * The MIT License + * + * Copyright 2017 CloudBees, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package hudson.model.queue; + +import hudson.model.Queue; +import java.io.IOException; +import org.junit.Test; +import static org.junit.Assert.*; +import org.jvnet.hudson.test.Issue; + +@SuppressWarnings("deprecation") +public class AbstractQueueTaskTest { + + @Issue("JENKINS-47517") + @Test + public void causeOfBlockageOverrides() { + Queue.Task t = new LegacyTask(); + assertFalse(t.isBuildBlocked()); + assertNull(t.getWhyBlocked()); + assertNull(t.getCauseOfBlockage()); + } + static class LegacyTask extends AbstractQueueTask { + @Override + public boolean isBuildBlocked() { + return getCauseOfBlockage() != null; + } + @Override + public String getWhyBlocked() { + CauseOfBlockage causeOfBlockage = getCauseOfBlockage(); + return causeOfBlockage != null ? causeOfBlockage.getShortDescription() : null; + } + @Override + public String getName() { + return null; + } + @Override + public String getFullDisplayName() { + return null; + } + @Override + public void checkAbortPermission() { + } + @Override + public boolean hasAbortPermission() { + return false; + } + @Override + public String getUrl() { + return null; + } + @Override + public String getDisplayName() { + return null; + } + @Override + public Queue.Executable createExecutable() throws IOException { + throw new IOException(); + } + } + +} diff --git a/test/src/test/java/hudson/model/QueueTest.java b/test/src/test/java/hudson/model/QueueTest.java index 1518b404ab..ca506b3a95 100644 --- a/test/src/test/java/hudson/model/QueueTest.java +++ b/test/src/test/java/hudson/model/QueueTest.java @@ -547,8 +547,7 @@ public class QueueTest { @Override public int hashCode() { return cnt.hashCode(); } - @Override public boolean isBuildBlocked() {return isBlocked;} - @Override public String getWhyBlocked() {return null;} + @Override public CauseOfBlockage getCauseOfBlockage() {return isBlocked ? CauseOfBlockage.fromMessage(Messages._Queue_Unknown()) : null;} @Override public String getName() {return "test";} @Override public String getFullDisplayName() {return "Test";} @Override public void checkAbortPermission() {} From 50eb7f1c5662d2554239660713203a38664d9b65 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 20 Oct 2017 03:03:42 -0400 Subject: [PATCH 25/29] Slave.JnlpJar.getURL did not work in some modes when core had a snapshot dependency on Remoting. (#3069) --- core/src/main/java/hudson/model/Slave.java | 52 +++++++++++++++++++--- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/hudson/model/Slave.java b/core/src/main/java/hudson/model/Slave.java index f83b5c06a3..cde11411fe 100644 --- a/core/src/main/java/hudson/model/Slave.java +++ b/core/src/main/java/hudson/model/Slave.java @@ -31,6 +31,7 @@ import hudson.FilePath; import hudson.Launcher; import hudson.Launcher.RemoteLauncher; import hudson.Util; +import hudson.cli.CLI; import hudson.model.Descriptor.FormException; import hudson.remoting.Callable; import hudson.remoting.Channel; @@ -47,6 +48,7 @@ import hudson.util.ClockDifference; import hudson.util.DescribableList; import hudson.util.FormValidation; import java.io.File; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.Serializable; @@ -57,6 +59,8 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Set; +import java.util.jar.JarFile; +import java.util.jar.Manifest; import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.CheckForNull; @@ -398,20 +402,58 @@ public abstract class Slave extends Node implements Serializable { throw new MalformedURLException("The specified file path " + fileName + " is not allowed due to security reasons"); } - if (name.equals("hudson-cli.jar")) { - name="jenkins-cli.jar"; + if (name.equals("hudson-cli.jar") || name.equals("jenkins-cli.jar")) { + File cliJar = Which.jarFile(CLI.class); + if (cliJar.isFile()) { + name = "jenkins-cli.jar"; + } else { + URL res = findExecutableJar(cliJar, CLI.class); + if (res != null) { + return res; + } + } } else if (name.equals("agent.jar") || name.equals("slave.jar") || name.equals("remoting.jar")) { - name = "lib/" + Which.jarFile(Channel.class).getName(); + File remotingJar = Which.jarFile(hudson.remoting.Launcher.class); + if (remotingJar.isFile()) { + name = "lib/" + remotingJar.getName(); + } else { + URL res = findExecutableJar(remotingJar, hudson.remoting.Launcher.class); + if (res != null) { + return res; + } + } } URL res = Jenkins.getInstance().servletContext.getResource("/WEB-INF/" + name); if(res==null) { - // during the development this path doesn't have the files. - res = new URL(new File(".").getAbsoluteFile().toURI().toURL(),"target/jenkins/WEB-INF/"+name); + throw new FileNotFoundException(name); // giving up + } else { + LOGGER.log(Level.FINE, "found {0}", res); } return res; } + /** Useful for {@code JenkinsRule.createSlave}, {@code hudson-dev:run}, etc. */ + private @CheckForNull URL findExecutableJar(File notActuallyJAR, Class mainClass) throws IOException { + if (notActuallyJAR.getName().equals("classes")) { + File[] siblings = notActuallyJAR.getParentFile().listFiles(); + if (siblings != null) { + for (File actualJar : siblings) { + if (actualJar.getName().endsWith(".jar")) { + try (JarFile jf = new JarFile(actualJar, false)) { + Manifest mf = jf.getManifest(); + if (mf != null && mainClass.getName().equals(mf.getMainAttributes().getValue("Main-Class"))) { + LOGGER.log(Level.FINE, "found {0}", actualJar); + return actualJar.toURI().toURL(); + } + } + } + } + } + } + return null; + } + public byte[] readFully() throws IOException { try (InputStream in = connect().getInputStream()) { return IOUtils.toByteArray(in); From 9c5c14a9fbe1c6714939967773b36ec7e032d5cf Mon Sep 17 00:00:00 2001 From: Wadeck Follonier Date: Sat, 21 Oct 2017 09:37:19 +0200 Subject: [PATCH 26/29] Add a default implementation for SecurityListener (#3077) * - add a default implementation doing nothing for the different event on SecurityListener. * - remove the useless non-implemented method in this inner class. --- .../security/LastGrantedAuthoritiesProperty.java | 12 ------------ .../main/java/jenkins/security/SecurityListener.java | 10 +++++----- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/core/src/main/java/jenkins/security/LastGrantedAuthoritiesProperty.java b/core/src/main/java/jenkins/security/LastGrantedAuthoritiesProperty.java index 0a2ec20625..cfa46856fd 100644 --- a/core/src/main/java/jenkins/security/LastGrantedAuthoritiesProperty.java +++ b/core/src/main/java/jenkins/security/LastGrantedAuthoritiesProperty.java @@ -90,14 +90,6 @@ public class LastGrantedAuthoritiesProperty extends UserProperty { */ @Extension public static class SecurityListenerImpl extends SecurityListener { - @Override - protected void authenticated(@Nonnull UserDetails details) { - } - - @Override - protected void failedToAuthenticate(@Nonnull String username) { - } - @Override protected void loggedIn(@Nonnull String username) { try { @@ -143,10 +135,6 @@ public class LastGrantedAuthoritiesProperty extends UserProperty { // LOGGER.log(Level.WARNING, "Failed to record granted authorities",e); // } } - - @Override - protected void loggedOut(@Nonnull String username) { - } } @Extension @Symbol("lastGrantedAuthorities") diff --git a/core/src/main/java/jenkins/security/SecurityListener.java b/core/src/main/java/jenkins/security/SecurityListener.java index 7cec8c0eea..f8c8ca6604 100644 --- a/core/src/main/java/jenkins/security/SecurityListener.java +++ b/core/src/main/java/jenkins/security/SecurityListener.java @@ -50,34 +50,34 @@ public abstract class SecurityListener implements ExtensionPoint { * Only {@link AbstractPasswordBasedSecurityRealm}s are considered. * @param details details of the newly authenticated user, such as name and groups */ - protected abstract void authenticated(@Nonnull UserDetails details); + protected void authenticated(@Nonnull UserDetails details){} /** * Fired when a user tried to authenticate by password but failed. * @param username the user * @see #authenticated */ - protected abstract void failedToAuthenticate(@Nonnull String username); + protected void failedToAuthenticate(@Nonnull String username){} /** * Fired when a user has logged in via the web UI. * Would be called after {@link #authenticated}. * @param username the user */ - protected abstract void loggedIn(@Nonnull String username); + protected void loggedIn(@Nonnull String username){} /** * Fired when a user has failed to log in via the web UI. * Would be called after {@link #failedToAuthenticate}. * @param username the user */ - protected abstract void failedToLogIn(@Nonnull String username); + protected void failedToLogIn(@Nonnull String username){} /** * Fired when a user logs out. * @param username the user */ - protected abstract void loggedOut(@Nonnull String username); + protected void loggedOut(@Nonnull String username){} /** @since 1.569 */ public static void fireAuthenticated(@Nonnull UserDetails details) { From a82c4fcc518b9475aa069ebcd180c0bb646341c8 Mon Sep 17 00:00:00 2001 From: Emilio Escobar Date: Sun, 22 Oct 2017 00:03:45 +0200 Subject: [PATCH 27/29] [JENKINS-47500] Secret.decrypt launches ArrayIndexOutOfBoundsException when data is "{}" (#3097) * [JENKINS-47500] unit test for JENKINS-47500 bug * [JENKINS-47500] return null when the data is just {} * [JENKINS-47500] added more cases --- core/src/main/java/hudson/util/Secret.java | 12 +++- .../test/java/hudson/util/SecretUtilTest.java | 65 +++++++++++++++++++ 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 core/src/test/java/hudson/util/SecretUtilTest.java diff --git a/core/src/main/java/hudson/util/Secret.java b/core/src/main/java/hudson/util/Secret.java index e8380e7b04..599467414e 100644 --- a/core/src/main/java/hudson/util/Secret.java +++ b/core/src/main/java/hudson/util/Secret.java @@ -165,7 +165,7 @@ public final class Secret implements Serializable { */ @CheckForNull public static Secret decrypt(@CheckForNull String data) { - if(data==null) return null; + if(!isValidData(data)) return null; if (data.startsWith("{") && data.endsWith("}")) { //likely CBC encrypted/containing metadata but could be plain text byte[] payload; @@ -215,6 +215,16 @@ public final class Secret implements Serializable { } } + private static boolean isValidData(String data) { + if (data == null || "{}".equals(data) || "".equals(data.trim())) return false; + + if (data.startsWith("{") && data.endsWith("}")) { + return !"".equals(data.substring(1, data.length()-1).trim()); + } + + return true; + } + /** * Workaround for JENKINS-6459 / http://java.net/jira/browse/GLASSFISH-11862 * This method uses specific provider selected via hudson.util.Secret.provider system property diff --git a/core/src/test/java/hudson/util/SecretUtilTest.java b/core/src/test/java/hudson/util/SecretUtilTest.java new file mode 100644 index 0000000000..9dcf90d5ce --- /dev/null +++ b/core/src/test/java/hudson/util/SecretUtilTest.java @@ -0,0 +1,65 @@ +package hudson.util; + +import org.junit.Assert; +import org.junit.Test; +import org.jvnet.hudson.test.Issue; + +public class SecretUtilTest { + + @Issue("JENKINS-47500") + @Test + public void decrypt() throws Exception { + String data = "{}"; + + try { + Secret secret = Secret.decrypt(data); + Assert.assertNull(secret); + } catch (ArrayIndexOutOfBoundsException e) { + Assert.fail(data + " shouldn't throw an ArrayIndexOutOfBoundsException but returning null"); + } + + } + + + @Issue("JENKINS-47500") + @Test + public void decryptJustSpace() throws Exception { + String data = " "; + + try { + Secret secret = Secret.decrypt(data); + Assert.assertNull(secret); + } catch (ArrayIndexOutOfBoundsException e) { + Assert.fail(data + " shouldn't throw an ArrayIndexOutOfBoundsException but returning null"); + } + + } + + @Issue("JENKINS-47500") + @Test + public void decryptWithSpace() throws Exception { + String data = "{ }"; + + try { + Secret secret = Secret.decrypt(data); + Assert.assertNull(secret); + } catch (ArrayIndexOutOfBoundsException e) { + Assert.fail(data + " shouldn't throw an ArrayIndexOutOfBoundsException but returning null"); + } + + } + + @Issue("JENKINS-47500") + @Test + public void decryptWithSpaces() throws Exception { + String data = "{ }"; + + try { + Secret secret = Secret.decrypt(data); + Assert.assertNull(secret); + } catch (ArrayIndexOutOfBoundsException e) { + Assert.fail(data + " shouldn't throw an ArrayIndexOutOfBoundsException but returning null"); + } + + } +} From 8c0ea07d5d3d8dd87c9b2401ffe2733dac4649d1 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 22 Oct 2017 17:56:23 -0700 Subject: [PATCH 28/29] [maven-release-plugin] prepare release jenkins-2.86 --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index a09bd73f5e..c8334ef64d 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.86-SNAPSHOT + 2.86 cli diff --git a/core/pom.xml b/core/pom.xml index a17f3dd5ca..59cffec2fa 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.86-SNAPSHOT + 2.86 jenkins-core diff --git a/pom.xml b/pom.xml index 931d8758d1..b083763fc4 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.86-SNAPSHOT + 2.86 pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - HEAD + jenkins-2.86 diff --git a/test/pom.xml b/test/pom.xml index dbc31ddad1..f18f045344 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.86-SNAPSHOT + 2.86 test diff --git a/war/pom.xml b/war/pom.xml index f5338c7310..cd4bd39b7b 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.86-SNAPSHOT + 2.86 jenkins-war From 790068c8486cdd4741336f9d61de72a9a6537a30 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sun, 22 Oct 2017 17:56:23 -0700 Subject: [PATCH 29/29] [maven-release-plugin] prepare for next development iteration --- cli/pom.xml | 2 +- core/pom.xml | 2 +- pom.xml | 4 ++-- test/pom.xml | 2 +- war/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/pom.xml b/cli/pom.xml index c8334ef64d..7e07d5a12e 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.86 + 2.87-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index 59cffec2fa..5d47e1d6a1 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.86 + 2.87-SNAPSHOT jenkins-core diff --git a/pom.xml b/pom.xml index b083763fc4..632ab7b772 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.86 + 2.87-SNAPSHOT pom Jenkins main module @@ -58,7 +58,7 @@ THE SOFTWARE. scm:git:git://github.com/jenkinsci/jenkins.git scm:git:ssh://git@github.com/jenkinsci/jenkins.git https://github.com/jenkinsci/jenkins - jenkins-2.86 + HEAD diff --git a/test/pom.xml b/test/pom.xml index f18f045344..ce5c4262a1 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.86 + 2.87-SNAPSHOT test diff --git a/war/pom.xml b/war/pom.xml index cd4bd39b7b..1c4625ec0f 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.86 + 2.87-SNAPSHOT jenkins-war