[JIRA] (JENKINS-51462) archiveArtifacts not working inside() docker containers

2018-05-22 Thread r...@akom.net (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Alexander Komarov updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-51462  
 
 
  archiveArtifacts not working inside() docker containers
 

  
 
 
 
 

 
Change By: 
 Alexander Komarov  
 

  
 
 
 
 

 
 The following Pipeline code produces an error:{code:java}def image = docker.image("any_existing_image_eg_alpine")image.inside {sh 'date > /tmp/test.txt'sh 'cat /tmp/test.txt' //works, shows filedef fileContents = readFile '/tmp/test.txt' //worksecho "Contents: ${fileContents}" //works, shows filearchiveArtifacts '/tmp/*.txt' //FAILS}{code} No matter what pattern I've tried with  archiveArtifacts , it  always reports that it matched no files .  It does not appear to be looking on the docker host either  (except in $WORKSPACE ,  because '/**' or '**' also match nothing  see below) .DSL steps in docker summary (what I've tried): * *readFile()*: works correctly  on files in or out of $WORKSPACE  * *writeFile()*: works correctly  on files in or out of $WORKSPACE  * *fileExists()*:  incorrect  works correctly only on files in $WORKSPACE  ( reports false when file exists auto-mounted volume ) * *archiveArtifacts()*:  ( archives only files  under  in  $WORKSPACE  tree while   in inside ( ) ( auto-mounted  volume )  )    So I guess there is a pattern ... and yet the behavior is inconsistent.    I could not find any documentation that explains what the rules are.   
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

[JIRA] (JENKINS-51462) archiveArtifacts not working inside() docker containers

2018-05-22 Thread r...@akom.net (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Alexander Komarov updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-51462  
 
 
  archiveArtifacts not working inside() docker containers
 

  
 
 
 
 

 
Change By: 
 Alexander Komarov  
 

  
 
 
 
 

 
 The following Pipeline code produces an error:{code:java}def image = docker.image("any_existing_image_eg_alpine")image.inside {sh 'date > /tmp/test.txt'sh 'cat /tmp/test.txt' //works, shows filedef fileContents = readFile '/tmp/test.txt' //worksecho "Contents: ${fileContents}" //works, shows filearchiveArtifacts '/tmp/*.txt' //FAILS}{code}No matter what pattern I've tried with archiveArtifacts, it always reports that it matched no files.  It does not appear to be looking on the docker host either, because '/**' or '**' also match nothing.DSL steps in docker summary (what I've tried): * *readFile()*: works correctly * *writeFile()*: works correctly * *fileExists()*: incorrect (reports false when file exists) * *archiveArtifacts()*: (archives  nothing  only files under $WORKSPACE tree  while in inside()  (auto-mounted  )  )    
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

 

[JIRA] (JENKINS-51462) archiveArtifacts not working inside() docker containers

2018-05-22 Thread r...@akom.net (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Alexander Komarov updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-51462  
 
 
  archiveArtifacts not working inside() docker containers
 

  
 
 
 
 

 
Change By: 
 Alexander Komarov  
 

  
 
 
 
 

 
 The following Pipeline code produces an error:{code:java}def  container  image  = docker.image("any_existing_image_eg_alpine") container image .inside {sh 'date > /tmp/test.txt'sh 'cat /tmp/test.txt' //works, shows filedef fileContents = readFile '/tmp/test.txt' //worksecho "Contents: ${fileContents}" //works, shows filearchiveArtifacts '/tmp/*.txt' //FAILS}{code}No matter what pattern I've tried with archiveArtifacts, it always reports that it matched no files.  It does not appear to be looking on the docker host either, because '/**' or '**' also match nothing. The interesting thing is that readFile works.  DSL steps in docker summary (what  I've  even  tried  using writeFile ): * *readFile ()  to create the file, it made no difference. *: works correctly  Update  * *writeFile()* :  "  works correctly * * fileExists " also fails in a container  ( returns )*: incorrect (reports  false when file exists) , even though readFile works.   * *archiveArtifacts()*: (archives nothing while in inside() )      
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
   

[JIRA] (JENKINS-51462) archiveArtifacts not working inside() docker containers

2018-05-22 Thread r...@akom.net (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Alexander Komarov updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-51462  
 
 
  archiveArtifacts not working inside() docker containers
 

  
 
 
 
 

 
Change By: 
 Alexander Komarov  
 

  
 
 
 
 

 
 The following Pipeline code produces an error:{code:java}def container = docker.image("any_existing_image_eg_alpine")container.inside {sh 'date > /tmp/test.txt'sh 'cat /tmp/test.txt' //works, shows filedef fileContents = readFile '/tmp/test.txt' //worksecho "Contents: ${fileContents}" //works, shows filearchiveArtifacts '/tmp/*.txt' //FAILS}{code}No matter what pattern I've tried with archiveArtifacts, it always reports that it matched no files.  It does not appear to be looking on the docker host either, because '/**' or '**' also match nothing.The interesting thing is that readFile works.  I've even tried using writeFile() to create the file, it made no difference. Update: "fileExists" also fails in a container (returns false when file exists), even though readFile works.    
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 
 

[JIRA] (JENKINS-51462) archiveArtifacts not working inside() docker containers

2018-05-22 Thread r...@akom.net (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Alexander Komarov edited a comment on  JENKINS-51462  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: archiveArtifacts not working inside() docker containers
 

  
 
 
 
 

 
 Workaround is to  first copy the necessary files to the $WORKSPACE that is automatically mounted in the container (or   [copy files from image to host|http://larstechnica.com/2017/05/docker-copy-files-from-image-to-local]  first  by running docker commands in a shell step .  Brittle but gets the job done. )    
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-51462) archiveArtifacts not working inside() docker containers

2018-05-22 Thread r...@akom.net (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Alexander Komarov commented on  JENKINS-51462  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: archiveArtifacts not working inside() docker containers
 

  
 
 
 
 

 
 Workaround is to copy files from image to host first by running docker commands in a shell step.  Brittle but gets the job done.    
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-51462) archiveArtifacts not working inside() docker containers

2018-05-21 Thread r...@akom.net (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Alexander Komarov updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-51462  
 
 
  archiveArtifacts not working inside() docker containers
 

  
 
 
 
 

 
Change By: 
 Alexander Komarov  
 

  
 
 
 
 

 
 The following Pipeline code produces an error:{code:java}def container = docker.image("any_existing_image_eg_alpine")container.inside {sh 'date > /tmp/test.txt'sh 'cat /tmp/test.txt' //works, shows filedef fileContents = readFile '/tmp/test.txt' //worksecho "Contents: ${fileContents}" //works, shows filearchiveArtifacts '/tmp/*.txt' //FAILS}{code}No matter what pattern I've tried with archiveArtifacts, it always reports that it matched no files.  It does not appear to be looking on the docker host either, because '/ \ **' or '**' also match nothing.The interesting thing is that readFile works.   I've even tried using writeFile() to create the file, it made no difference.    
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups 

[JIRA] (JENKINS-51462) archiveArtifacts not working inside() docker containers

2018-05-21 Thread r...@akom.net (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Alexander Komarov updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-51462  
 
 
  archiveArtifacts not working inside() docker containers
 

  
 
 
 
 

 
Change By: 
 Alexander Komarov  
 

  
 
 
 
 

 
 The following Pipeline code produces an error:{code:java}def container = docker.image("any_existing_image_eg_alpine")container.inside {sh 'date > /tmp/test.txt'sh 'cat /tmp/test.txt' //works, shows filedef fileContents = readFile '/tmp/test.txt' //worksecho "Contents: ${fileContents}" //works, shows filearchiveArtifacts '/tmp/*.txt' //FAILS}{code}No matter what pattern I've tried with archiveArtifacts, it always reports that it matched no files.  It does not appear to be looking on the docker host either, because '/ \ * * ' or '* * ' also match nothing.The interesting thing is that readFile works.   
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving 

[JIRA] (JENKINS-51462) archiveArtifacts not working inside() docker containers

2018-05-21 Thread r...@akom.net (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Alexander Komarov created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-51462  
 
 
  archiveArtifacts not working inside() docker containers
 

  
 
 
 
 

 
Issue Type: 
  Bug  
 
 
Assignee: 
 Unassigned  
 
 
Components: 
 docker-workflow-plugin  
 
 
Created: 
 2018-05-21 22:54  
 
 
Environment: 
 Jenkins 2.112  Docker Pipeline 1.15, 1.17  
 
 
Priority: 
  Minor  
 
 
Reporter: 
 Alexander Komarov  
 

  
 
 
 
 

 
 The following Pipeline code produces an error: 

 

def container = docker.image("any_existing_image_eg_alpine")
container.inside {
sh 'date > /tmp/test.txt'
sh 'cat /tmp/test.txt' //works, shows file

def fileContents = readFile '/tmp/test.txt' //works
echo "Contents: ${fileContents}" //works, shows file

archiveArtifacts '/tmp/*.txt' //FAILS
}
 

 No matter what pattern I've tried with archiveArtifacts, it always reports that it matched no files.  It does not appear to be looking on the docker host either, because '/' or '' also match nothing. The interesting thing is that readFile works.