Skip to content
Permalink
Browse files

[FIXED JENKINS-6045] Dropped fix for JENKINS-6045 since required Jenk…

…ins version (1.409) includes it
  • Loading branch information
rseguy
rseguy committed Oct 4, 2011
1 parent 62d8cfd commit 1bd4d393856c3ce001f08af187f6601366f0509c
@@ -4,7 +4,7 @@ Copyright © 2009-2011, Manufacture Française des Pneumatiques Michelin, Ro

About this plugin
-----------------
The Copy To Slave plugin is meant to be used from or [Jenkins][2] to provide a way to copy files located somewhere on Jenkins' master node to the jobs' workspaces. Please take a look at [Jenkins' wiki][3] to get detailed information.
The Copy To Slave plugin is meant to be used from [Jenkins][2] to provide a way to copy files located somewhere on Jenkins' master node to the jobs' workspaces. Please take a look at [Jenkins' wiki][3] to get detailed information.

Installation
------------
@@ -90,7 +90,6 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListener lis
includes, StringUtils.isBlank(excludes) ? "nothing" : '\'' + excludes + '\'', projectWorkspaceOnSlave.toURI(),
Computer.currentComputer().getNode(), destinationFilePath.toURI());

CopyToSlaveUtils.hudson5977(projectWorkspaceOnSlave); // HUDSON-6045
projectWorkspaceOnSlave.copyRecursiveTo(includes, excludes, destinationFilePath);
}
else if(Computer.currentComputer() instanceof MasterComputer) {
@@ -114,8 +114,6 @@ else if(RELATIVE_TO_HOME.equals(relativeTo)) {
includes, StringUtils.isBlank(excludes) ? "nothing" : '\'' + excludes + '\'', rootFilePathOnMaster.toURI(),
projectWorkspaceOnSlave.toURI(), Computer.currentComputer().getNode().getDisplayName());

CopyToSlaveUtils.hudson5977(projectWorkspaceOnSlave); // HUDSON-6045

// HUDSON-7999
MyFilePath.copyRecursiveTo(
rootFilePathOnMaster,
@@ -1,8 +1,7 @@
/*
* The MIT License
*
* Copyright (c) 2010, Manufacture Française des Pneumatiques Michelin, Romain Seguy
* Copyright (c) 2004-2010, Sun Microsystems, Inc., Alan Harder
* Copyright (c) 2010-2011, Manufacture Française des Pneumatiques Michelin, Romain Seguy
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -29,11 +28,8 @@
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.FreeStyleProject;
import hudson.model.Hudson;
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;

@@ -79,32 +75,6 @@ public static FilePath getProjectWorkspaceOnMaster(AbstractProject project, Prin
return projectWorkspaceOnMaster;
}

/**
* Workaround for HUDSON-5977.
*
* <p>The code of this method comes from the copyartifact plugin by Alan Harder,
* more precisely from {@code hudson.plugins.copyartifact.CopyArtifact.perform()},
* with some minor modifications.
* Cf. MIT License header.</p>
*/
public static void hudson5977(FilePath targetDir) throws IOException, InterruptedException {
// Workaround for HUDSON-5977.. this block can be removed whenever
// copyartifact plugin raises its minimum Hudson version to whatever
// release fixes #5977.
// Make a call to copy a small file, to get all class-loading to happen.
// When we copy the real stuff there won't be any classloader requests
// coming the other direction, which due to full-buffer-deadlock problem
// can cause slave to hang.
URL base = Hudson.getInstance().getPluginManager()
.getPlugin("copy-to-slave").baseResourceURL;
if (base!=null && "file".equals(base.getProtocol())) {
FilePath tmp = targetDir.createTempDir("copy-to-slave", ".dir");
MyFilePath.copyRecursiveTo(new FilePath(new File(base.getPath())), "HUDSON-5977/**", null, false, false, tmp);
tmp.deleteRecursive();
}
// End workaround
}

private final static Logger LOGGER = Logger.getLogger(CopyToSlaveUtils.class.getName());

}

This file was deleted.

0 comments on commit 1bd4d39

Please sign in to comment.
You can’t perform that action at this time.