Can Jenkins store artifacts outside the job directory?












14















I currently have Jenkins set up with a number of jobs, but it's proving difficult to back up because the artifacts are stored within the job directory. I'd like to back up the job configurations and artifacts separately. I'm sure I remember reading somewhere that Jenkins now has an option to store them outside the job, but I can't find this.



Is there any configuration option that does this while still making the artifacts visible from within the job on the Jenkins interface? (ie rather than merely an add-in that copies the artifacts elsewhere)










share|improve this question



























    14















    I currently have Jenkins set up with a number of jobs, but it's proving difficult to back up because the artifacts are stored within the job directory. I'd like to back up the job configurations and artifacts separately. I'm sure I remember reading somewhere that Jenkins now has an option to store them outside the job, but I can't find this.



    Is there any configuration option that does this while still making the artifacts visible from within the job on the Jenkins interface? (ie rather than merely an add-in that copies the artifacts elsewhere)










    share|improve this question

























      14












      14








      14


      4






      I currently have Jenkins set up with a number of jobs, but it's proving difficult to back up because the artifacts are stored within the job directory. I'd like to back up the job configurations and artifacts separately. I'm sure I remember reading somewhere that Jenkins now has an option to store them outside the job, but I can't find this.



      Is there any configuration option that does this while still making the artifacts visible from within the job on the Jenkins interface? (ie rather than merely an add-in that copies the artifacts elsewhere)










      share|improve this question














      I currently have Jenkins set up with a number of jobs, but it's proving difficult to back up because the artifacts are stored within the job directory. I'd like to back up the job configurations and artifacts separately. I'm sure I remember reading somewhere that Jenkins now has an option to store them outside the job, but I can't find this.



      Is there any configuration option that does this while still making the artifacts visible from within the job on the Jenkins interface? (ie rather than merely an add-in that copies the artifacts elsewhere)







      hudson jenkins artifacts






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 28 '12 at 13:50









      the_mandrillthe_mandrill

      23k45185




      23k45185
























          6 Answers
          6






          active

          oldest

          votes


















          12














          Go to your jenkins configuration page, e.g.



          http://mybuildserver.acme.com/configure


          At the top of the configuration page there is a "home directory" setting. Click the "advanced..." button below it.



          Now set the "Workspace Root Directory" to e:jenkins-workspaces${ITEM_FULL_NAME}, and "Build Record Root Directory" to e:jenkins-builds${ITEM_FULL_NAME} or something similar.



          Warning: I run Jenkins 2.7.2 and noticed that certain features don't work properly after configuring Jenkins like that. I saw problems with folders and problems with the multi-branch project plugin. Check the status of those issues if your rely on these features.






          share|improve this answer





















          • 1





            Seems like the newer versions of Jenkins no longer support the 'advanced' option in the UI. Source

            – Adam
            Oct 26 '18 at 14:23



















          6














          As you can see here, there are many plugins to deploy artifacts anywhere you want/need, on FTP, CIFS, Confluence, Artifactory.... especially the ArtifactsDeployer that will allow you to make a copy of the artifacts in the Jenkins Home.






          share|improve this answer





















          • 2





            Thanks, looks useful, but I suspect that the ArtifactsDeployer won't do exactly what I need as it says, "due to the Jenkins design, it's not possible for example, to extend the 'archived artifacts' feature to archive artifacts in other locations."

            – the_mandrill
            Feb 28 '12 at 15:23






          • 1





            Take a second look at ArtifactDeployer. It can COPY the artifacts to another location, like on the network. And there's an ADVANCED option "Delete remote artifacts when the build is deleted" that will also delete the files when the build is deleted. Now, you really have two copies of the artifacts: one in the Jenkins job/build directory, one on the network.

            – Jason Swager
            Feb 28 '12 at 15:36






          • 2





            Problem is, I was wanting to avoid having it in the job directory, but still have the artifacts linked from the job status page.

            – the_mandrill
            Feb 28 '12 at 18:32











          • Artifactory's plugin maintains a badge link on each build run to it's corresponding build info in Artifactory, if this is of any help.

            – noamt
            Feb 29 '12 at 7:14



















          1














          Try the Use Custom Workspace build option. From the Jenkins popup help:




          For each job on Jenkins, Jenkins allocates a unique "workspace
          directory." This is the directory where the code is checked out and
          builds happen. Normally you should let Jenkins allocate and clean up
          workspace directories, but in several situations this is problematic,
          and in such case, this option lets you specify the workspace location
          manually.




          This option is also available under advanced project properties of multi-configuration project builds.






          share|improve this answer































            0














            A groovy script under "Prepare an environment for the run" will always run on the master, and this groovy script can create a symlink to where you really want artifacts archiving to archive_to which SHOULD include the job name and build number:



            if (! Files.createSymbolicLink(Paths.get(currentBuild.artifactsDir.path),
            Paths.get(archive_to.getCanonicalPath()))) {
            throw new RuntimeException("Can't create symlink to archive dir")
            }


            Of course (sadly) when old builds are purged by Jenkins the old artifacts are left because jenkins will not follow a symlink when purging, even if jenkins owns the symlink and the target (shame).



            I workaround for that may be to point a symlink back from the new archive dir, then, when jenkins purges it's archive dir, the new symlink will dangle and a cron job can then later delete the new job archive dir






            share|improve this answer































              0














              Thank you Sam, for your post, which directed me into the right direction to solve my problem.
              Have been searching for a way on how can I make a symlink to the Job-Archive of a build for multibranch projects. Up to now, we used to manually search for the correct folder basename in the filesystem and added that one to the Jenkinsfile.
              Now, I can simply use



              jobOutputFolder = currentBuild.rawBuild.artifactsDir.path


              and use that in my script.
              If security is a concern, I could implement that as a shared library additionally.






              share|improve this answer































                -1














                Copy Artifact Plugin (https://wiki.jenkins-ci.org/display/JENKINS/Copy+Artifact+Plugin) adds a build step for retrieving files from another project's workspace to current and work from there.






                share|improve this answer























                  Your Answer






                  StackExchange.ifUsing("editor", function () {
                  StackExchange.using("externalEditor", function () {
                  StackExchange.using("snippets", function () {
                  StackExchange.snippets.init();
                  });
                  });
                  }, "code-snippets");

                  StackExchange.ready(function() {
                  var channelOptions = {
                  tags: "".split(" "),
                  id: "1"
                  };
                  initTagRenderer("".split(" "), "".split(" "), channelOptions);

                  StackExchange.using("externalEditor", function() {
                  // Have to fire editor after snippets, if snippets enabled
                  if (StackExchange.settings.snippets.snippetsEnabled) {
                  StackExchange.using("snippets", function() {
                  createEditor();
                  });
                  }
                  else {
                  createEditor();
                  }
                  });

                  function createEditor() {
                  StackExchange.prepareEditor({
                  heartbeatType: 'answer',
                  autoActivateHeartbeat: false,
                  convertImagesToLinks: true,
                  noModals: true,
                  showLowRepImageUploadWarning: true,
                  reputationToPostImages: 10,
                  bindNavPrevention: true,
                  postfix: "",
                  imageUploader: {
                  brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                  contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                  allowUrls: true
                  },
                  onDemand: true,
                  discardSelector: ".discard-answer"
                  ,immediatelyShowMarkdownHelp:true
                  });


                  }
                  });














                  draft saved

                  draft discarded


















                  StackExchange.ready(
                  function () {
                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f9483126%2fcan-jenkins-store-artifacts-outside-the-job-directory%23new-answer', 'question_page');
                  }
                  );

                  Post as a guest















                  Required, but never shown

























                  6 Answers
                  6






                  active

                  oldest

                  votes








                  6 Answers
                  6






                  active

                  oldest

                  votes









                  active

                  oldest

                  votes






                  active

                  oldest

                  votes









                  12














                  Go to your jenkins configuration page, e.g.



                  http://mybuildserver.acme.com/configure


                  At the top of the configuration page there is a "home directory" setting. Click the "advanced..." button below it.



                  Now set the "Workspace Root Directory" to e:jenkins-workspaces${ITEM_FULL_NAME}, and "Build Record Root Directory" to e:jenkins-builds${ITEM_FULL_NAME} or something similar.



                  Warning: I run Jenkins 2.7.2 and noticed that certain features don't work properly after configuring Jenkins like that. I saw problems with folders and problems with the multi-branch project plugin. Check the status of those issues if your rely on these features.






                  share|improve this answer





















                  • 1





                    Seems like the newer versions of Jenkins no longer support the 'advanced' option in the UI. Source

                    – Adam
                    Oct 26 '18 at 14:23
















                  12














                  Go to your jenkins configuration page, e.g.



                  http://mybuildserver.acme.com/configure


                  At the top of the configuration page there is a "home directory" setting. Click the "advanced..." button below it.



                  Now set the "Workspace Root Directory" to e:jenkins-workspaces${ITEM_FULL_NAME}, and "Build Record Root Directory" to e:jenkins-builds${ITEM_FULL_NAME} or something similar.



                  Warning: I run Jenkins 2.7.2 and noticed that certain features don't work properly after configuring Jenkins like that. I saw problems with folders and problems with the multi-branch project plugin. Check the status of those issues if your rely on these features.






                  share|improve this answer





















                  • 1





                    Seems like the newer versions of Jenkins no longer support the 'advanced' option in the UI. Source

                    – Adam
                    Oct 26 '18 at 14:23














                  12












                  12








                  12







                  Go to your jenkins configuration page, e.g.



                  http://mybuildserver.acme.com/configure


                  At the top of the configuration page there is a "home directory" setting. Click the "advanced..." button below it.



                  Now set the "Workspace Root Directory" to e:jenkins-workspaces${ITEM_FULL_NAME}, and "Build Record Root Directory" to e:jenkins-builds${ITEM_FULL_NAME} or something similar.



                  Warning: I run Jenkins 2.7.2 and noticed that certain features don't work properly after configuring Jenkins like that. I saw problems with folders and problems with the multi-branch project plugin. Check the status of those issues if your rely on these features.






                  share|improve this answer















                  Go to your jenkins configuration page, e.g.



                  http://mybuildserver.acme.com/configure


                  At the top of the configuration page there is a "home directory" setting. Click the "advanced..." button below it.



                  Now set the "Workspace Root Directory" to e:jenkins-workspaces${ITEM_FULL_NAME}, and "Build Record Root Directory" to e:jenkins-builds${ITEM_FULL_NAME} or something similar.



                  Warning: I run Jenkins 2.7.2 and noticed that certain features don't work properly after configuring Jenkins like that. I saw problems with folders and problems with the multi-branch project plugin. Check the status of those issues if your rely on these features.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Nov 4 '16 at 12:52

























                  answered Jan 2 '14 at 11:27









                  Wim CoenenWim Coenen

                  57.2k8136223




                  57.2k8136223








                  • 1





                    Seems like the newer versions of Jenkins no longer support the 'advanced' option in the UI. Source

                    – Adam
                    Oct 26 '18 at 14:23














                  • 1





                    Seems like the newer versions of Jenkins no longer support the 'advanced' option in the UI. Source

                    – Adam
                    Oct 26 '18 at 14:23








                  1




                  1





                  Seems like the newer versions of Jenkins no longer support the 'advanced' option in the UI. Source

                  – Adam
                  Oct 26 '18 at 14:23





                  Seems like the newer versions of Jenkins no longer support the 'advanced' option in the UI. Source

                  – Adam
                  Oct 26 '18 at 14:23













                  6














                  As you can see here, there are many plugins to deploy artifacts anywhere you want/need, on FTP, CIFS, Confluence, Artifactory.... especially the ArtifactsDeployer that will allow you to make a copy of the artifacts in the Jenkins Home.






                  share|improve this answer





















                  • 2





                    Thanks, looks useful, but I suspect that the ArtifactsDeployer won't do exactly what I need as it says, "due to the Jenkins design, it's not possible for example, to extend the 'archived artifacts' feature to archive artifacts in other locations."

                    – the_mandrill
                    Feb 28 '12 at 15:23






                  • 1





                    Take a second look at ArtifactDeployer. It can COPY the artifacts to another location, like on the network. And there's an ADVANCED option "Delete remote artifacts when the build is deleted" that will also delete the files when the build is deleted. Now, you really have two copies of the artifacts: one in the Jenkins job/build directory, one on the network.

                    – Jason Swager
                    Feb 28 '12 at 15:36






                  • 2





                    Problem is, I was wanting to avoid having it in the job directory, but still have the artifacts linked from the job status page.

                    – the_mandrill
                    Feb 28 '12 at 18:32











                  • Artifactory's plugin maintains a badge link on each build run to it's corresponding build info in Artifactory, if this is of any help.

                    – noamt
                    Feb 29 '12 at 7:14
















                  6














                  As you can see here, there are many plugins to deploy artifacts anywhere you want/need, on FTP, CIFS, Confluence, Artifactory.... especially the ArtifactsDeployer that will allow you to make a copy of the artifacts in the Jenkins Home.






                  share|improve this answer





















                  • 2





                    Thanks, looks useful, but I suspect that the ArtifactsDeployer won't do exactly what I need as it says, "due to the Jenkins design, it's not possible for example, to extend the 'archived artifacts' feature to archive artifacts in other locations."

                    – the_mandrill
                    Feb 28 '12 at 15:23






                  • 1





                    Take a second look at ArtifactDeployer. It can COPY the artifacts to another location, like on the network. And there's an ADVANCED option "Delete remote artifacts when the build is deleted" that will also delete the files when the build is deleted. Now, you really have two copies of the artifacts: one in the Jenkins job/build directory, one on the network.

                    – Jason Swager
                    Feb 28 '12 at 15:36






                  • 2





                    Problem is, I was wanting to avoid having it in the job directory, but still have the artifacts linked from the job status page.

                    – the_mandrill
                    Feb 28 '12 at 18:32











                  • Artifactory's plugin maintains a badge link on each build run to it's corresponding build info in Artifactory, if this is of any help.

                    – noamt
                    Feb 29 '12 at 7:14














                  6












                  6








                  6







                  As you can see here, there are many plugins to deploy artifacts anywhere you want/need, on FTP, CIFS, Confluence, Artifactory.... especially the ArtifactsDeployer that will allow you to make a copy of the artifacts in the Jenkins Home.






                  share|improve this answer















                  As you can see here, there are many plugins to deploy artifacts anywhere you want/need, on FTP, CIFS, Confluence, Artifactory.... especially the ArtifactsDeployer that will allow you to make a copy of the artifacts in the Jenkins Home.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Feb 28 '12 at 14:06

























                  answered Feb 28 '12 at 13:58









                  Cédric JulienCédric Julien

                  55.3k1299111




                  55.3k1299111








                  • 2





                    Thanks, looks useful, but I suspect that the ArtifactsDeployer won't do exactly what I need as it says, "due to the Jenkins design, it's not possible for example, to extend the 'archived artifacts' feature to archive artifacts in other locations."

                    – the_mandrill
                    Feb 28 '12 at 15:23






                  • 1





                    Take a second look at ArtifactDeployer. It can COPY the artifacts to another location, like on the network. And there's an ADVANCED option "Delete remote artifacts when the build is deleted" that will also delete the files when the build is deleted. Now, you really have two copies of the artifacts: one in the Jenkins job/build directory, one on the network.

                    – Jason Swager
                    Feb 28 '12 at 15:36






                  • 2





                    Problem is, I was wanting to avoid having it in the job directory, but still have the artifacts linked from the job status page.

                    – the_mandrill
                    Feb 28 '12 at 18:32











                  • Artifactory's plugin maintains a badge link on each build run to it's corresponding build info in Artifactory, if this is of any help.

                    – noamt
                    Feb 29 '12 at 7:14














                  • 2





                    Thanks, looks useful, but I suspect that the ArtifactsDeployer won't do exactly what I need as it says, "due to the Jenkins design, it's not possible for example, to extend the 'archived artifacts' feature to archive artifacts in other locations."

                    – the_mandrill
                    Feb 28 '12 at 15:23






                  • 1





                    Take a second look at ArtifactDeployer. It can COPY the artifacts to another location, like on the network. And there's an ADVANCED option "Delete remote artifacts when the build is deleted" that will also delete the files when the build is deleted. Now, you really have two copies of the artifacts: one in the Jenkins job/build directory, one on the network.

                    – Jason Swager
                    Feb 28 '12 at 15:36






                  • 2





                    Problem is, I was wanting to avoid having it in the job directory, but still have the artifacts linked from the job status page.

                    – the_mandrill
                    Feb 28 '12 at 18:32











                  • Artifactory's plugin maintains a badge link on each build run to it's corresponding build info in Artifactory, if this is of any help.

                    – noamt
                    Feb 29 '12 at 7:14








                  2




                  2





                  Thanks, looks useful, but I suspect that the ArtifactsDeployer won't do exactly what I need as it says, "due to the Jenkins design, it's not possible for example, to extend the 'archived artifacts' feature to archive artifacts in other locations."

                  – the_mandrill
                  Feb 28 '12 at 15:23





                  Thanks, looks useful, but I suspect that the ArtifactsDeployer won't do exactly what I need as it says, "due to the Jenkins design, it's not possible for example, to extend the 'archived artifacts' feature to archive artifacts in other locations."

                  – the_mandrill
                  Feb 28 '12 at 15:23




                  1




                  1





                  Take a second look at ArtifactDeployer. It can COPY the artifacts to another location, like on the network. And there's an ADVANCED option "Delete remote artifacts when the build is deleted" that will also delete the files when the build is deleted. Now, you really have two copies of the artifacts: one in the Jenkins job/build directory, one on the network.

                  – Jason Swager
                  Feb 28 '12 at 15:36





                  Take a second look at ArtifactDeployer. It can COPY the artifacts to another location, like on the network. And there's an ADVANCED option "Delete remote artifacts when the build is deleted" that will also delete the files when the build is deleted. Now, you really have two copies of the artifacts: one in the Jenkins job/build directory, one on the network.

                  – Jason Swager
                  Feb 28 '12 at 15:36




                  2




                  2





                  Problem is, I was wanting to avoid having it in the job directory, but still have the artifacts linked from the job status page.

                  – the_mandrill
                  Feb 28 '12 at 18:32





                  Problem is, I was wanting to avoid having it in the job directory, but still have the artifacts linked from the job status page.

                  – the_mandrill
                  Feb 28 '12 at 18:32













                  Artifactory's plugin maintains a badge link on each build run to it's corresponding build info in Artifactory, if this is of any help.

                  – noamt
                  Feb 29 '12 at 7:14





                  Artifactory's plugin maintains a badge link on each build run to it's corresponding build info in Artifactory, if this is of any help.

                  – noamt
                  Feb 29 '12 at 7:14











                  1














                  Try the Use Custom Workspace build option. From the Jenkins popup help:




                  For each job on Jenkins, Jenkins allocates a unique "workspace
                  directory." This is the directory where the code is checked out and
                  builds happen. Normally you should let Jenkins allocate and clean up
                  workspace directories, but in several situations this is problematic,
                  and in such case, this option lets you specify the workspace location
                  manually.




                  This option is also available under advanced project properties of multi-configuration project builds.






                  share|improve this answer




























                    1














                    Try the Use Custom Workspace build option. From the Jenkins popup help:




                    For each job on Jenkins, Jenkins allocates a unique "workspace
                    directory." This is the directory where the code is checked out and
                    builds happen. Normally you should let Jenkins allocate and clean up
                    workspace directories, but in several situations this is problematic,
                    and in such case, this option lets you specify the workspace location
                    manually.




                    This option is also available under advanced project properties of multi-configuration project builds.






                    share|improve this answer


























                      1












                      1








                      1







                      Try the Use Custom Workspace build option. From the Jenkins popup help:




                      For each job on Jenkins, Jenkins allocates a unique "workspace
                      directory." This is the directory where the code is checked out and
                      builds happen. Normally you should let Jenkins allocate and clean up
                      workspace directories, but in several situations this is problematic,
                      and in such case, this option lets you specify the workspace location
                      manually.




                      This option is also available under advanced project properties of multi-configuration project builds.






                      share|improve this answer













                      Try the Use Custom Workspace build option. From the Jenkins popup help:




                      For each job on Jenkins, Jenkins allocates a unique "workspace
                      directory." This is the directory where the code is checked out and
                      builds happen. Normally you should let Jenkins allocate and clean up
                      workspace directories, but in several situations this is problematic,
                      and in such case, this option lets you specify the workspace location
                      manually.




                      This option is also available under advanced project properties of multi-configuration project builds.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Jan 7 '13 at 13:18









                      Justin RoweJustin Rowe

                      1,73711513




                      1,73711513























                          0














                          A groovy script under "Prepare an environment for the run" will always run on the master, and this groovy script can create a symlink to where you really want artifacts archiving to archive_to which SHOULD include the job name and build number:



                          if (! Files.createSymbolicLink(Paths.get(currentBuild.artifactsDir.path),
                          Paths.get(archive_to.getCanonicalPath()))) {
                          throw new RuntimeException("Can't create symlink to archive dir")
                          }


                          Of course (sadly) when old builds are purged by Jenkins the old artifacts are left because jenkins will not follow a symlink when purging, even if jenkins owns the symlink and the target (shame).



                          I workaround for that may be to point a symlink back from the new archive dir, then, when jenkins purges it's archive dir, the new symlink will dangle and a cron job can then later delete the new job archive dir






                          share|improve this answer




























                            0














                            A groovy script under "Prepare an environment for the run" will always run on the master, and this groovy script can create a symlink to where you really want artifacts archiving to archive_to which SHOULD include the job name and build number:



                            if (! Files.createSymbolicLink(Paths.get(currentBuild.artifactsDir.path),
                            Paths.get(archive_to.getCanonicalPath()))) {
                            throw new RuntimeException("Can't create symlink to archive dir")
                            }


                            Of course (sadly) when old builds are purged by Jenkins the old artifacts are left because jenkins will not follow a symlink when purging, even if jenkins owns the symlink and the target (shame).



                            I workaround for that may be to point a symlink back from the new archive dir, then, when jenkins purges it's archive dir, the new symlink will dangle and a cron job can then later delete the new job archive dir






                            share|improve this answer


























                              0












                              0








                              0







                              A groovy script under "Prepare an environment for the run" will always run on the master, and this groovy script can create a symlink to where you really want artifacts archiving to archive_to which SHOULD include the job name and build number:



                              if (! Files.createSymbolicLink(Paths.get(currentBuild.artifactsDir.path),
                              Paths.get(archive_to.getCanonicalPath()))) {
                              throw new RuntimeException("Can't create symlink to archive dir")
                              }


                              Of course (sadly) when old builds are purged by Jenkins the old artifacts are left because jenkins will not follow a symlink when purging, even if jenkins owns the symlink and the target (shame).



                              I workaround for that may be to point a symlink back from the new archive dir, then, when jenkins purges it's archive dir, the new symlink will dangle and a cron job can then later delete the new job archive dir






                              share|improve this answer













                              A groovy script under "Prepare an environment for the run" will always run on the master, and this groovy script can create a symlink to where you really want artifacts archiving to archive_to which SHOULD include the job name and build number:



                              if (! Files.createSymbolicLink(Paths.get(currentBuild.artifactsDir.path),
                              Paths.get(archive_to.getCanonicalPath()))) {
                              throw new RuntimeException("Can't create symlink to archive dir")
                              }


                              Of course (sadly) when old builds are purged by Jenkins the old artifacts are left because jenkins will not follow a symlink when purging, even if jenkins owns the symlink and the target (shame).



                              I workaround for that may be to point a symlink back from the new archive dir, then, when jenkins purges it's archive dir, the new symlink will dangle and a cron job can then later delete the new job archive dir







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Sep 25 '18 at 11:26









                              Sam LiddicottSam Liddicott

                              485314




                              485314























                                  0














                                  Thank you Sam, for your post, which directed me into the right direction to solve my problem.
                                  Have been searching for a way on how can I make a symlink to the Job-Archive of a build for multibranch projects. Up to now, we used to manually search for the correct folder basename in the filesystem and added that one to the Jenkinsfile.
                                  Now, I can simply use



                                  jobOutputFolder = currentBuild.rawBuild.artifactsDir.path


                                  and use that in my script.
                                  If security is a concern, I could implement that as a shared library additionally.






                                  share|improve this answer




























                                    0














                                    Thank you Sam, for your post, which directed me into the right direction to solve my problem.
                                    Have been searching for a way on how can I make a symlink to the Job-Archive of a build for multibranch projects. Up to now, we used to manually search for the correct folder basename in the filesystem and added that one to the Jenkinsfile.
                                    Now, I can simply use



                                    jobOutputFolder = currentBuild.rawBuild.artifactsDir.path


                                    and use that in my script.
                                    If security is a concern, I could implement that as a shared library additionally.






                                    share|improve this answer


























                                      0












                                      0








                                      0







                                      Thank you Sam, for your post, which directed me into the right direction to solve my problem.
                                      Have been searching for a way on how can I make a symlink to the Job-Archive of a build for multibranch projects. Up to now, we used to manually search for the correct folder basename in the filesystem and added that one to the Jenkinsfile.
                                      Now, I can simply use



                                      jobOutputFolder = currentBuild.rawBuild.artifactsDir.path


                                      and use that in my script.
                                      If security is a concern, I could implement that as a shared library additionally.






                                      share|improve this answer













                                      Thank you Sam, for your post, which directed me into the right direction to solve my problem.
                                      Have been searching for a way on how can I make a symlink to the Job-Archive of a build for multibranch projects. Up to now, we used to manually search for the correct folder basename in the filesystem and added that one to the Jenkinsfile.
                                      Now, I can simply use



                                      jobOutputFolder = currentBuild.rawBuild.artifactsDir.path


                                      and use that in my script.
                                      If security is a concern, I could implement that as a shared library additionally.







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Nov 25 '18 at 13:05









                                      schlm3schlm3

                                      507




                                      507























                                          -1














                                          Copy Artifact Plugin (https://wiki.jenkins-ci.org/display/JENKINS/Copy+Artifact+Plugin) adds a build step for retrieving files from another project's workspace to current and work from there.






                                          share|improve this answer




























                                            -1














                                            Copy Artifact Plugin (https://wiki.jenkins-ci.org/display/JENKINS/Copy+Artifact+Plugin) adds a build step for retrieving files from another project's workspace to current and work from there.






                                            share|improve this answer


























                                              -1












                                              -1








                                              -1







                                              Copy Artifact Plugin (https://wiki.jenkins-ci.org/display/JENKINS/Copy+Artifact+Plugin) adds a build step for retrieving files from another project's workspace to current and work from there.






                                              share|improve this answer













                                              Copy Artifact Plugin (https://wiki.jenkins-ci.org/display/JENKINS/Copy+Artifact+Plugin) adds a build step for retrieving files from another project's workspace to current and work from there.







                                              share|improve this answer












                                              share|improve this answer



                                              share|improve this answer










                                              answered Jul 24 '13 at 11:38









                                              jmujmu

                                              3,21911712




                                              3,21911712






























                                                  draft saved

                                                  draft discarded




















































                                                  Thanks for contributing an answer to Stack Overflow!


                                                  • Please be sure to answer the question. Provide details and share your research!

                                                  But avoid



                                                  • Asking for help, clarification, or responding to other answers.

                                                  • Making statements based on opinion; back them up with references or personal experience.


                                                  To learn more, see our tips on writing great answers.




                                                  draft saved


                                                  draft discarded














                                                  StackExchange.ready(
                                                  function () {
                                                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f9483126%2fcan-jenkins-store-artifacts-outside-the-job-directory%23new-answer', 'question_page');
                                                  }
                                                  );

                                                  Post as a guest















                                                  Required, but never shown





















































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown

































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown







                                                  Popular posts from this blog

                                                  To store a contact into the json file from server.js file using a class in NodeJS

                                                  Redirect URL with Chrome Remote Debugging Android Devices

                                                  Dieringhausen