jenkinsci / jenkinsfile-runner

A command line tool to run Jenkinsfile as a function
MIT License
1.13k stars 291 forks source link

War downloaded and exploded every time #594

Open cdupont opened 2 years ago

cdupont commented 2 years ago

I use V1.0-beta30. I get this for every invocation of jenkinsfile-runner:

$ jenkinsfile-runner                                                                            
No explicit version has been selected, using latest LTS                                                                                                                                                     
Running pipeline on jenkins 2.303.3                                         
Downloading jenkins 2.303.3...                                                                                                                                                                              
Following redirect...                                                                                                                                                                                       
Exploding /home/cdupont/.jenkinsfile-runner/war/2.303.3/jenkins-war-2.303.3.war, this might take some time. 

Is it possible to cache the exploded war to save on time?

dudil commented 2 years ago

Hi @cdupont - just a fellow developer (not maintainer here). as a workaround you can explode manually the files before the first run and it will be cached,

I am using a docker and prepared a custom Dockerfile where: It is including the following line (was taken from various examples)

# We need to explode the jenkins.war for JFR
RUN cd /usr/share/jenkins && jar -xvf jenkins.war

If you are not using docker you can just run that on your machine

I hope it helps 🙏

paullewisn commented 2 years ago

Maybe help for a future reader, obvious, but something I initially overlooked:

After you have exploded the war file, this path needs to be supplied to the -w switch.

$ jenkinsfile-runner  -w /path/to/exploded/files/
oleg-nenashev commented 1 year ago

I am not sure the auto-download feature should be kept as a default behavior. The current Java implementation is less efficient than wget/curl. It makes sense to keep it, but behind an --autodownload flag

thisisatestuseraccount commented 1 year ago

Manually downloading and decompressing the WAR is more effort than specifying a Jenkins version, but it seems necessary to skip a long download and extraction process. Would it be more user friendly to cache the extracted directory per Jenkins version?