Jenkins GUI only shown after waiting for 2 minutes

前端 未结 6 1120
我寻月下人不归
我寻月下人不归 2021-01-01 02:02

My Jenkins version is Jenkins 1.508. Some googling around seemed to indicate that I needed a small change in my jenkins.xml (see for instance http://devophuman.blogspot.nl/2

6条回答
  •  长情又很酷
    2021-01-01 02:46

    We have implemented a quick and dirty work around. Just create a job in Jenkins which periodically invokes the following shell script:

    wget http://localhost:8080/view/All/ -O /dev/null
    

    This reduces the load times for all views (since Jenkins has to take the hit himself) for our users.

    As stated in the comment the wget only loads the job view. In order to interate all jobs we are using the following curl script (Linux based host):

    Jenkins 1.x;

    for x in ` curl 'http://localhost:8080/api/xml?tree=jobs\[url\]' | sed 's//\n/g' |  sed 's/<\/url>//g' | sed 's///g'| sed 's///g' | sed 's/<\/job>//g' | grep http | sed 's/your.jenkins.host.domain/localhost:8080/' ` ; do curl "$x" -o /dev/null ;done
    

    Jenkins 2.x;

    for x in `  curl 'http://localhost:8080/api/xml?tree=jobs\[url\]' | sed 's//\n/g' |  sed 's/<\/url.*//g' | grep http | sed 's/your.jenkins.host.domain/localhost:8080/' ` ; do curl "$x" -o /dev/null ;done
    

    You can of course to the same thing for views (http://localhost:8080/api/xml?tree=views[url])

提交回复
热议问题