mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-07 17:15:59 +00:00
Stop builds in the order they are provided from the CLI (#6456)
This commit is contained in:
1 parent
a6fa7b3abd
commit
bdfdbca821
1 file changed
+4
-2
@@ -31,8 +31,9 @@ import hudson.model.Item;
|
||||
import hudson.model.Job;
|
||||
import hudson.model.Run;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import jenkins.model.Jenkins;
|
||||
import org.kohsuke.accmod.Restricted;
|
||||
import org.kohsuke.accmod.restrictions.NoExternalUse;
|
||||
@@ -55,7 +56,8 @@ public class StopBuildsCommand extends CLICommand {
|
||||
@Override
|
||||
protected int run() throws Exception {
|
||||
Jenkins jenkins = Jenkins.get();
|
||||
final HashSet<String> names = new HashSet<>(jobNames);
|
||||
// Deduplicate job names, but preserve the order specified by the user.
|
||||
final Set<String> names = new LinkedHashSet<>(jobNames);
|
||||
|
||||
final List<Job> jobsToStop = new ArrayList<>();
|
||||
for (final String jobName : names) {
|
||||
|
||||
Reference in new issue
Block a user