Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
JENKINS-36524 # The deployment of a library without a remote dir set
must fail.
  • Loading branch information
rachaumi committed Jun 28, 2017
1 parent 90ee174 commit 20a9c60
Showing 1 changed file with 10 additions and 2 deletions.
Expand Up @@ -221,7 +221,11 @@ private void deploy(DeploymentTask task, AbstractBuild<?, ?> build, BuildListene
//Par defaut si ftp n'est pas renseigne on prend le host
String ftpHost = StringUtils.isBlank(weblogicEnvironmentTargeted.getFtpHost()) ? weblogicEnvironmentTargeted.getHost() : weblogicEnvironmentTargeted.getFtpHost();
// path to remote resource
remoteFilePath = weblogicEnvironmentTargeted.getRemoteDir() + "/" + fullArtifactFinalName;
if(StringUtils.isBlank(weblogicEnvironmentTargeted.getRemoteDir())){
listener.getLogger().println("[WeblogicDeploymentPlugin] - Remote directory configured in plugin xml configuration must be set for library deployment. Please check your configuration.");
throw new IOException("Remote directory configured in plugin xml configuration must be set for library deployment");
}
remoteFilePath = weblogicEnvironmentTargeted.getRemoteDir().concat("/").concat(fullArtifactFinalName);
String localFilePath = archivedArtifact.getRemote();
listener.getLogger().println("[WeblogicDeploymentPlugin] - TRANSFERING LIBRARY : (local=" +localFilePath+ ") (remote=" + remoteFilePath + ") to (ftp=" +ftpHost + "@" +weblogicEnvironmentTargeted.getFtpUser()+ ") ...");
FTPUtils.transfertFile(new TransfertConfiguration(ftpHost, weblogicEnvironmentTargeted.getFtpUser(), weblogicEnvironmentTargeted.getFtpPassowrd(), localFilePath, remoteFilePath),listener.getLogger());
Expand Down Expand Up @@ -302,7 +306,11 @@ private void customize(DeploymentTask task, AbstractBuild<?, ?> build, BuildList
//Par defaut si ftp n'est pas renseigne on prend le host
String ftpHost = StringUtils.isBlank(weblogicEnvironmentTargeted.getFtpHost()) ? weblogicEnvironmentTargeted.getHost() : weblogicEnvironmentTargeted.getFtpHost();
// path to remote resource
remoteFilePath = weblogicEnvironmentTargeted.getRemoteDir() + "/" + fullArtifactFinalName;
if(StringUtils.isBlank(weblogicEnvironmentTargeted.getRemoteDir())){
listener.getLogger().println("[WeblogicDeploymentPlugin] - Remote directory configured in plugin xml configuration must be set for library deployment. Please check your configuration.");
throw new IOException("Remote directory configured in plugin xml configuration must be set for library deployment");
}
remoteFilePath = weblogicEnvironmentTargeted.getRemoteDir().concat("/").concat(fullArtifactFinalName);
String localFilePath = archivedArtifact.getRemote();
listener.getLogger().println("[WeblogicDeploymentPlugin] - TRANSFERING LIBRARY : (local=" +fullArtifactFinalName+ ") (remote=" + remoteFilePath + ") to (ftp=" +ftpHost + "@" +weblogicEnvironmentTargeted.getFtpUser()+ ") ...");
FTPUtils.transfertFile(new TransfertConfiguration(ftpHost, weblogicEnvironmentTargeted.getFtpUser(), weblogicEnvironmentTargeted.getFtpPassowrd(), localFilePath, remoteFilePath),listener.getLogger());
Expand Down

0 comments on commit 20a9c60

Please sign in to comment.