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)) diff --git a/cli/pom.xml b/cli/pom.xml index a09bd73f5e..7e07d5a12e 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.main pom - 2.86-SNAPSHOT + 2.87-SNAPSHOT cli diff --git a/core/pom.xml b/core/pom.xml index a17f3dd5ca..5d47e1d6a1 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,7 +29,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.86-SNAPSHOT + 2.87-SNAPSHOT jenkins-core diff --git a/core/src/main/java/hudson/ClassicPluginStrategy.java b/core/src/main/java/hudson/ClassicPluginStrategy.java index 5981ade069..b53ac9978f 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.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. */ @@ -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/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/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 { 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/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; } diff --git a/core/src/main/java/hudson/model/ListView.java b/core/src/main/java/hudson/model/ListView.java index 22d6b6b038..ad9667f04c 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,7 +170,8 @@ public class ListView extends View implements DirectlyModifiableView { public DescribableList> getColumns() { return columns; } - + + /** * Returns a read-only view of all {@link Job}s in this view. * @@ -178,6 +181,20 @@ public class ListView extends View implements DirectlyModifiableView { */ @Override 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 + */ + private List getItems(boolean recurse) { SortedSet names; List items = new ArrayList(); @@ -217,6 +234,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/core/src/main/java/hudson/model/Queue.java b/core/src/main/java/hudson/model/Queue.java index 3ea6e8dacf..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, @@ -1841,9 +1845,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/core/src/main/java/hudson/model/Slave.java b/core/src/main/java/hudson/model/Slave.java index 3b9bbf42af..cde11411fe 100644 --- a/core/src/main/java/hudson/model/Slave.java +++ b/core/src/main/java/hudson/model/Slave.java @@ -26,15 +26,16 @@ 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; import hudson.Util; +import hudson.cli.CLI; 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; @@ -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; @@ -225,6 +229,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; } @@ -389,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); @@ -502,12 +553,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/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/main/java/hudson/slaves/CommandConnector.java b/core/src/main/java/hudson/slaves/CommandConnector.java deleted file mode 100644 index be23463986..0000000000 --- a/core/src/main/java/hudson/slaves/CommandConnector.java +++ /dev/null @@ -1,81 +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 org.jenkinsci.Symbol; -import org.kohsuke.stapler.DataBoundConstructor; - -import java.io.IOException; -import jenkins.model.Jenkins; -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; - Jenkins.getInstance().checkPermission(Jenkins.RUN_SCRIPTS); - } - - private Object readResolve() { - Jenkins.getInstance().checkPermission(Jenkins.RUN_SCRIPTS); - return this; - } - - @Override - public CommandLauncher launch(String host, TaskListener listener) throws IOException, InterruptedException { - return new CommandLauncher(command,new EnvVars("SLAVE",host)); - } - - @Extension @Symbol("command") - public static class DescriptorImpl extends ComputerConnectorDescriptor { - @Override - public String getDisplayName() { - return 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()); - } else { - return FormValidation.ok(); - } - } - - } -} diff --git a/core/src/main/java/hudson/slaves/CommandLauncher.java b/core/src/main/java/hudson/slaves/CommandLauncher.java deleted file mode 100644 index 2e42131863..0000000000 --- a/core/src/main/java/hudson/slaves/CommandLauncher.java +++ /dev/null @@ -1,212 +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.security.ACL; -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.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; - - @DataBoundConstructor - public CommandLauncher(String command) { - this(command, null); - } - - public CommandLauncher(String command, EnvVars env) { - this.agentCommand = command; - this.env = env; - Jenkins.getInstance().checkPermission(Jenkins.RUN_SCRIPTS); - } - - private Object readResolve() { - Jenkins.getInstance().checkPermission(Jenkins.RUN_SCRIPTS); - 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(hudson.model.Messages.Slave_Launching(getTimestamp())); - if(getCommand().trim().length()==0) { - listener.getLogger().println(Messages.CommandLauncher_NoLaunchCommand()); - return; - } - listener.getLogger().println("$ " + getCommand()); - - ProcessBuilder pb = new ProcessBuilder(Util.tokenize(getCommand())); - 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 (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 = hudson.model.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 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()); - else - return FormValidation.ok(); - } - } -} 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/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/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/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)); } /** 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) { diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/config_de.properties b/core/src/main/resources/hudson/model/AllView/newViewDetail_zh_CN.properties similarity index 89% rename from core/src/main/resources/hudson/slaves/CommandLauncher/config_de.properties rename to core/src/main/resources/hudson/model/AllView/newViewDetail_zh_CN.properties index 80a74d2cc3..38dc4d8bc8 100644 --- a/core/src/main/resources/hudson/slaves/CommandLauncher/config_de.properties +++ b/core/src/main/resources/hudson/model/AllView/newViewDetail_zh_CN.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Simon Wiest +# 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 @@ -20,4 +20,4 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -Launch\ command=Startkommando +blurb=\u8BE5\u89C6\u56FE\u663E\u793AJenkins\u4E2D\u6240\u6709\u7684\u4EFB\u52A1\u3002 diff --git a/core/src/main/resources/hudson/slaves/CommandConnector/config_zh_TW.properties b/core/src/main/resources/hudson/model/BooleanParameterDefinition/config_zh_CN.properties similarity index 89% rename from core/src/main/resources/hudson/slaves/CommandConnector/config_zh_TW.properties rename to core/src/main/resources/hudson/model/BooleanParameterDefinition/config_zh_CN.properties index 4827b2c10b..0703474e44 100644 --- a/core/src/main/resources/hudson/slaves/CommandConnector/config_zh_TW.properties +++ b/core/src/main/resources/hudson/model/BooleanParameterDefinition/config_zh_CN.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2013, Chunghwa Telecom Co., Ltd., Pei-Tang Huang +# 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 @@ -19,5 +19,6 @@ # 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 +Name=\u540D\u79F0 +Default\ Value=\u9ED8\u8BA4\u503C +Description=\u8BF4\u660E 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/slaves/CommandLauncher/config_pt_BR.properties b/core/src/main/resources/hudson/model/Job/rename_zh_CN.properties similarity index 70% rename from core/src/main/resources/hudson/slaves/CommandLauncher/config_pt_BR.properties rename to core/src/main/resources/hudson/model/Job/rename_zh_CN.properties index 6554a4c42b..0ddc3baefd 100644 --- a/core/src/main/resources/hudson/slaves/CommandLauncher/config_pt_BR.properties +++ b/core/src/main/resources/hudson/model/Job/rename_zh_CN.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Reginaldo L. Russinholi, Cleiber Silva +# 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 @@ -20,4 +20,9 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -Launch\ command=Executar comando +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/slaves/CommandLauncher/config_es.properties b/core/src/main/resources/hudson/model/ListView/newJobButtonBar_zh_CN.properties similarity index 90% rename from core/src/main/resources/hudson/slaves/CommandLauncher/config_es.properties rename to core/src/main/resources/hudson/model/ListView/newJobButtonBar_zh_CN.properties index 1976127bf0..d5345a7bad 100644 --- a/core/src/main/resources/hudson/slaves/CommandLauncher/config_es.properties +++ b/core/src/main/resources/hudson/model/ListView/newJobButtonBar_zh_CN.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# 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 @@ -20,4 +20,4 @@ # 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 +Add\ to\ current\ view=\u6DFB\u52A0\u5230\u5F53\u524D\u89C6\u56FE 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/CommandLauncher/config_fr.properties b/core/src/main/resources/hudson/model/MyView/newViewDetail_zh_CN.properties similarity index 86% rename from core/src/main/resources/hudson/slaves/CommandLauncher/config_fr.properties rename to core/src/main/resources/hudson/model/MyView/newViewDetail_zh_CN.properties index 8a80348a9f..fba0db8a81 100644 --- a/core/src/main/resources/hudson/slaves/CommandLauncher/config_fr.properties +++ b/core/src/main/resources/hudson/model/MyView/newViewDetail_zh_CN.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Eric Lefevre-Ardant +# 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 @@ -20,4 +20,5 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -Launch\ command=Commande de lancement +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/slaves/CommandLauncher/config_sv_SE.properties b/core/src/main/resources/hudson/model/User/builds_zh_CN.properties similarity index 93% rename from core/src/main/resources/hudson/slaves/CommandLauncher/config_sv_SE.properties rename to core/src/main/resources/hudson/model/User/builds_zh_CN.properties index 78f777b97d..88416f2cca 100644 --- a/core/src/main/resources/hudson/slaves/CommandLauncher/config_sv_SE.properties +++ b/core/src/main/resources/hudson/model/User/builds_zh_CN.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2010, Sun Microsystems, Inc. +# 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 @@ -19,5 +19,4 @@ # 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 +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/slaves/CommandConnector/config_pt_BR.properties b/core/src/main/resources/hudson/model/User/delete_zh_CN.properties similarity index 83% rename from core/src/main/resources/hudson/slaves/CommandConnector/config_pt_BR.properties rename to core/src/main/resources/hudson/model/User/delete_zh_CN.properties index 397b9ea131..2ea812e80a 100644 --- a/core/src/main/resources/hudson/slaves/CommandConnector/config_pt_BR.properties +++ b/core/src/main/resources/hudson/model/User/delete_zh_CN.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributers +# 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 @@ -20,4 +20,5 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -Launch\ command=Comando de lan\u00e7amento +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/builds.jelly b/core/src/main/resources/hudson/model/View/builds.jelly index f7c1fc97c5..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.
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/slaves/CommandConnector/config_es.properties b/core/src/main/resources/hudson/model/View/delete_zh_CN.properties similarity index 86% rename from core/src/main/resources/hudson/slaves/CommandConnector/config_es.properties rename to core/src/main/resources/hudson/model/View/delete_zh_CN.properties index f2c1318370..a5babeee82 100644 --- a/core/src/main/resources/hudson/slaves/CommandConnector/config_es.properties +++ b/core/src/main/resources/hudson/model/View/delete_zh_CN.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributers +# 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 @@ -20,4 +20,5 @@ # 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 +Are\ you\ sure\ about\ deleting\ the\ view?=\u4F60\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u89C6\u56FE\u5417\uFF1F +Yes=\u786E\u5B9A 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 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/CommandConnector/config.jelly b/core/src/main/resources/hudson/slaves/CommandConnector/config.jelly deleted file mode 100644 index 37b017955d..0000000000 --- a/core/src/main/resources/hudson/slaves/CommandConnector/config.jelly +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/core/src/main/resources/hudson/slaves/CommandConnector/config_sr.properties b/core/src/main/resources/hudson/slaves/CommandConnector/config_sr.properties deleted file mode 100644 index 67a16da6ab..0000000000 --- a/core/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/core/src/main/resources/hudson/slaves/CommandLauncher/config.jelly b/core/src/main/resources/hudson/slaves/CommandLauncher/config.jelly deleted file mode 100644 index 37b017955d..0000000000 --- a/core/src/main/resources/hudson/slaves/CommandLauncher/config.jelly +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/config_bg.properties b/core/src/main/resources/hudson/slaves/CommandLauncher/config_bg.properties deleted file mode 100644 index ee97be0e93..0000000000 --- a/core/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/core/src/main/resources/hudson/slaves/CommandLauncher/config_da.properties b/core/src/main/resources/hudson/slaves/CommandLauncher/config_da.properties deleted file mode 100644 index 841cac3361..0000000000 --- a/core/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/core/src/main/resources/hudson/slaves/CommandLauncher/config_ru.properties b/core/src/main/resources/hudson/slaves/CommandLauncher/config_ru.properties deleted file mode 100644 index a0bc405b48..0000000000 --- a/core/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/core/src/main/resources/hudson/slaves/CommandLauncher/config_sr.properties b/core/src/main/resources/hudson/slaves/CommandLauncher/config_sr.properties deleted file mode 100644 index f7053d115b..0000000000 --- a/core/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/core/src/main/resources/hudson/slaves/CommandLauncher/config_tr.properties b/core/src/main/resources/hudson/slaves/CommandLauncher/config_tr.properties deleted file mode 100644 index 151ee806c4..0000000000 --- a/core/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/core/src/main/resources/hudson/slaves/CommandLauncher/config_zh_TW.properties b/core/src/main/resources/hudson/slaves/CommandLauncher/config_zh_TW.properties deleted file mode 100644 index 4827b2c10b..0000000000 --- a/core/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/core/src/main/resources/hudson/slaves/CommandLauncher/help-command.html b/core/src/main/resources/hudson/slaves/CommandLauncher/help-command.html deleted file mode 100644 index 4602953b05..0000000000 --- a/core/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/core/src/main/resources/hudson/slaves/CommandLauncher/help-command_bg.html b/core/src/main/resources/hudson/slaves/CommandLauncher/help-command_bg.html deleted file mode 100644 index e1429361b2..0000000000 --- a/core/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/core/src/main/resources/hudson/slaves/CommandLauncher/help-command_fr.html b/core/src/main/resources/hudson/slaves/CommandLauncher/help-command_fr.html deleted file mode 100644 index d155bb47ee..0000000000 --- a/core/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/core/src/main/resources/hudson/slaves/CommandLauncher/help-command_ja.html b/core/src/main/resources/hudson/slaves/CommandLauncher/help-command_ja.html deleted file mode 100644 index f097c28a9d..0000000000 --- a/core/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/core/src/main/resources/hudson/slaves/CommandLauncher/help-command_ru.html b/core/src/main/resources/hudson/slaves/CommandLauncher/help-command_ru.html deleted file mode 100644 index 91d49385cb..0000000000 --- a/core/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/core/src/main/resources/hudson/slaves/CommandLauncher/help.jelly b/core/src/main/resources/hudson/slaves/CommandLauncher/help.jelly deleted file mode 100644 index f326f7fa28..0000000000 --- a/core/src/main/resources/hudson/slaves/CommandLauncher/help.jelly +++ /dev/null @@ -1,28 +0,0 @@ - - - - - ${%blurb} - \ No newline at end of file diff --git a/core/src/main/resources/hudson/slaves/CommandLauncher/help.properties b/core/src/main/resources/hudson/slaves/CommandLauncher/help.properties deleted file mode 100644 index ea17495f1d..0000000000 --- a/core/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/core/src/main/resources/hudson/slaves/CommandLauncher/help_bg.properties b/core/src/main/resources/hudson/slaves/CommandLauncher/help_bg.properties deleted file mode 100644 index 8efdbd543b..0000000000 --- a/core/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/core/src/main/resources/hudson/slaves/CommandLauncher/help_de.properties b/core/src/main/resources/hudson/slaves/CommandLauncher/help_de.properties deleted file mode 100644 index 0093fdac95..0000000000 --- a/core/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/core/src/main/resources/hudson/slaves/CommandLauncher/help_es.properties b/core/src/main/resources/hudson/slaves/CommandLauncher/help_es.properties deleted file mode 100644 index e56b6a0ab4..0000000000 --- a/core/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/core/src/main/resources/hudson/slaves/CommandLauncher/help_sr.properties b/core/src/main/resources/hudson/slaves/CommandLauncher/help_sr.properties deleted file mode 100644 index 1f0dde0773..0000000000 --- a/core/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/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_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/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/core/src/main/resources/hudson/slaves/CommandConnector/config_ja.properties b/core/src/main/resources/hudson/slaves/OfflineCause/ChannelTermination/cause_zh_CN.properties similarity index 91% rename from core/src/main/resources/hudson/slaves/CommandConnector/config_ja.properties rename to core/src/main/resources/hudson/slaves/OfflineCause/ChannelTermination/cause_zh_CN.properties index 86996d9a86..4cb665671b 100644 --- a/core/src/main/resources/hudson/slaves/CommandConnector/config_ja.properties +++ b/core/src/main/resources/hudson/slaves/OfflineCause/ChannelTermination/cause_zh_CN.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2012, Seiji Sogabe +# 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 @@ -20,4 +20,4 @@ # 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 +Connection\ was\ broken=\u8FDE\u63A5\u4E2D\u65AD diff --git a/core/src/main/resources/hudson/slaves/CommandConnector/config_de.properties b/core/src/main/resources/hudson/slaves/OfflineCause/LaunchFailed/cause_zh_CN.properties similarity index 87% rename from core/src/main/resources/hudson/slaves/CommandConnector/config_de.properties rename to core/src/main/resources/hudson/slaves/OfflineCause/LaunchFailed/cause_zh_CN.properties index 903a1a1512..2daf3239d0 100644 --- a/core/src/main/resources/hudson/slaves/CommandConnector/config_de.properties +++ b/core/src/main/resources/hudson/slaves/OfflineCause/LaunchFailed/cause_zh_CN.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-, Kohsuke Kawaguchi, Sun Microsystems, Inc., and a number of other of contributers +# 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 @@ -20,4 +20,4 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -Launch\ command=Startkommando +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/CommandLauncher/config_ja.properties b/core/src/main/resources/hudson/slaves/SlaveComputer/disconnect_zh_CN.properties similarity index 83% rename from core/src/main/resources/hudson/slaves/CommandLauncher/config_ja.properties rename to core/src/main/resources/hudson/slaves/SlaveComputer/disconnect_zh_CN.properties index a75df75423..aaa4ea2539 100644 --- a/core/src/main/resources/hudson/slaves/CommandLauncher/config_ja.properties +++ b/core/src/main/resources/hudson/slaves/SlaveComputer/disconnect_zh_CN.properties @@ -1,6 +1,6 @@ # The MIT License # -# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi +# 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 @@ -20,4 +20,4 @@ # 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 +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/CommandConnector/config_bg.properties b/core/src/main/resources/hudson/slaves/SlaveComputer/systemInfo_zh_CN.properties similarity index 83% rename from core/src/main/resources/hudson/slaves/CommandConnector/config_bg.properties rename to core/src/main/resources/hudson/slaves/SlaveComputer/systemInfo_zh_CN.properties index ee97be0e93..e37e96e1e6 100644 --- a/core/src/main/resources/hudson/slaves/CommandConnector/config_bg.properties +++ b/core/src/main/resources/hudson/slaves/SlaveComputer/systemInfo_zh_CN.properties @@ -1,6 +1,6 @@ # The MIT License # -# Bulgarian translation: Copyright (c) 2016, Alexander Shopov +# 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 @@ -20,5 +20,7 @@ # 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 +System\ Information=\u7CFB\u7EDF\u4FE1\u606F +System\ Properties=\u7CFB\u7EDF\u5C5E\u6027 +Environment\ Variables=\u73AF\u5883\u53D8\u91CF +Thread\ Dump=\u7EBF\u7A0B\u6253\u5370 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/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"); + } + + } +} diff --git a/pom.xml b/pom.xml index 931d8758d1..632ab7b772 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.86-SNAPSHOT + 2.87-SNAPSHOT pom Jenkins main module diff --git a/test/pom.xml b/test/pom.xml index 3b23730b6d..ce5c4262a1 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.86-SNAPSHOT + 2.87-SNAPSHOT test @@ -53,7 +53,7 @@ THE SOFTWARE. ${project.groupId} jenkins-test-harness - 2.28 + 2.31 test 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(); } } diff --git a/test/src/test/java/hudson/model/QueueTest.java b/test/src/test/java/hudson/model/QueueTest.java index 516bb4677a..5e626aea3c 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); @@ -547,8 +554,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() {} @@ -988,20 +994,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(); 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())); + } } diff --git a/test/src/test/java/hudson/slaves/CommandLauncher2Test.java b/test/src/test/java/hudson/slaves/CommandLauncher2Test.java deleted file mode 100644 index 7d9a6bd4d4..0000000000 --- a/test/src/test/java/hudson/slaves/CommandLauncher2Test.java +++ /dev/null @@ -1,157 +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.FailingHttpStatusCodeException; -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.net.HttpURLConnection; -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 static org.junit.Assert.*; -import org.junit.Rule; -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; - -public class CommandLauncher2Test { - - @Rule - public RestartableJenkinsRule rr = new RestartableJenkinsRule(); - - @Issue("SECURITY-478") - @Test - public void requireRunScripts() throws Exception { - rr.addStep(new Statement() { - @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")); - 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()); - assertSerialForm(s, "echo configured by CLI"); - // Now verify that all modes failed as dev. First as GUI. - 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()); - } - s = (DumbSlave) rr.j.jenkins.getNode("s"); - assertEquals("echo configured by admin", ((CommandLauncher) s.getLauncher()).getCommand()); - assertSerialForm(s, "echo configured by admin"); - // 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()); - } - 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")); - // 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()); - s = (DumbSlave) rr.j.jenkins.getNode("s"); - assertNotEquals(CommandLauncher.class, s.getLauncher().getClass()); - assertSerialForm(s, null); - // 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 - 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 configured by admin", ((CommandLauncher) s.getLauncher()).getCommand()); - } - }); - } - -} diff --git a/test/src/test/java/hudson/slaves/CommandLauncherTest.java b/test/src/test/java/hudson/slaves/CommandLauncherTest.java deleted file mode 100644 index 4800def882..0000000000 --- a/test/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/test/src/test/java/hudson/slaves/ComputerConnectorTest.java b/test/src/test/java/hudson/slaves/ComputerConnectorTest.java deleted file mode 100644 index 9112f4f10d..0000000000 --- a/test/src/test/java/hudson/slaves/ComputerConnectorTest.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 ComputerConnectorTest 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/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. */ 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 c3c01d69cd..1c4625ec0f 100644 --- a/war/pom.xml +++ b/war/pom.xml @@ -28,7 +28,7 @@ THE SOFTWARE. org.jenkins-ci.main pom - 2.86-SNAPSHOT + 2.87-SNAPSHOT jenkins-war @@ -404,6 +404,12 @@ THE SOFTWARE. 2.16.0 hpi + + org.jenkins-ci.plugins + command-launcher + 1.0 + hpi + ${project.build.directory}/${project.build.finalName}/WEB-INF/detached-plugins true