0
votes

we just started creating a Pipeline. Since we are deploying our Staging manuelly and not everbody has access to our Jenkins Server, we need to download the current build at our Jenkins-Portal. Here we face some Issues. Currently we create a .zip of our binaries and copy them to our Pipeline-worspace-Folder (Example: "D:\Jenkins\Pipeline\trunk\workspace") which can be accessed via the portal

  1. Any better solution to access the build (without an artifactory)?
  2. Another big issue here is that the .zip has 0,5 GB and in longterm that folder will get full. My idea would be to write a powershell which deletes all files where the modified date is older than 15 days.

Very welcome for your ideas / Snippets (Jenkins declarative Pipeline)

1

1 Answers

1
votes

Using shell script to clean up your workspace is perfectly fine solution, so you probably take that way.

Other thing is that workspace may be not the best place to store your files - workspace should be disposable and deleting it shouldn't harm you in any way. Because of that using a dedicated folder (outside of Jenkins workspace) would be safer and more flexible.

You might also consider using Jenkins archiveArtifacts step to store build results probably combined with buildDiscarder pipeline option. This is a preferred solution, but there's a catch - if your Jenkins is secured, access to artifacts requires authorization (which is not too hard to achieve, but it's a different story).