Re: Update all plugins automatically

2018-10-18 Thread Benjamin Brummer
You could setup a job which runs periodically on jenkins master.

Solution 1 ssh

# prepare info file
INFO_FILE=plugins.update.info
# CleanUp
rm -f *
touch $INFO_FILE
# get current version of cli JAR
wget http://127.0.0.1:8080/jnlpJars/jenkins-cli.jar
# update plugins
java -jar jenkins-cli.jar -ssh -user automationuser -i 
~/.ssh/automationuser/id_rsa list-plugins | grep ')$' >> ./report_raw || 
true
# format report-file
cat ./report_raw | sed s/'  '/'\t'/g >> ./report
# prepare update list
UPDATE_LIST=$( java -jar jenkins-cli.jar -ssh -user username -i 
~/path/to/id_rsa list-plugins | grep ')$' | cut -f 1 -d ' ' | sed 
':a;N;$!ba;s/\n/ /g' );
# update and create report
echo $UPDATE_LIST
if [ ! -z "${UPDATE_LIST}" ]; then
java -jar jenkins-cli.jar -ssh -user username -i ~/path/to/id_rsa 
install-plugin ${UPDATE_LIST};
java -jar jenkins-cli.jar -ssh -user username -i ~/path/to/id_rsa 
safe-restart;
echo 'Jenkins Plug-ins Update Report' >> $INFO_FILE
echo 'The following plug-in updates have been conducted:' >> $INFO_FILE
echo '' >> $INFO_FILE
echo 'Plug-in 
IDPlug-in nameOld VersionNew Version' >> $INFO_FILE
awk 'BEGIN { FS = "[()\t]+" } ;{print ""$1""$2""$3""$4""}' report >> $INFO_FILE
echo '' >> $INFO_FILE
else
echo 'Jenkins Plug-ins Update Report' >> $INFO_FILE
echo 'No updates for installed plug-ins were available!' 
>> $INFO_FILE
fi
Solution 2 token
# prepare info file
INFO_FILE=plugins.update.info
rm -f $INFO_FILE
# get current version of cli JAR
rm -f jenkins-cli.jar
wget http://127.0.0.1:8080/jnlpJars/jenkins-cli.jar
# update plugins
rm -f ./tmp
rm -f ./tmp2
java -jar jenkins-cli.jar -auth username:token -s http://127.0.0.1:8080/ 
list-plugins | grep ')$' >> ./tmp | cat ./tmp | sed s/'  '/'\t'/g >> ./tmp2
UPDATE_LIST=$( java -jar jenkins-cli.jar -auth username:token -s 
http://127.0.0.1:8080/ list-plugins | grep ')$' | cut -f 1 -d ' ' | sed 
':a;N;$!ba;s/\n/ /g' );
if [ ! -z "${UPDATE_LIST}" ]; then
java -jar jenkins-cli.jar -auth username:token -s 
http://127.0.0.1:8080/ install-plugin ${UPDATE_LIST};
java -jar jenkins-cli.jar -auth username:token -s 
http://127.0.0.1:8080/ safe-restart;
echo 'Jenkins Plug-ins Update Report' >> $INFO_FILE
echo 'The following plug-in updates have been conducted:' >> $INFO_FILE
echo '' >> $INFO_FILE
echo 'Plug-in 
IDPlug-in nameOld VersionNew Version' >> 
$INFO_FILE
awk 'BEGIN { FS = "[()\t]+" } ;{print ""$1""$2""$3""$4""}' tmp2 >> $INFO_FILE
echo '' >> $INFO_FILE
else
echo 'Jenkins Plug-ins Update Report' >> $INFO_FILE
echo 'No updates for installed plug-ins were 
available!'>> $INFO_FILE
fi



Am Mittwoch, 17. Oktober 2018 23:18:26 UTC+2 schrieb gotvi...@gmail.com:
>
> Hi,
>
> We are using open source Jenkins and have a bunch of plugins installed.  
> Is there a way to update all the plugins that are in the "Updates" section 
> in the Plugin Manager?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/91f2a236-5e5d-4451-b84a-b042a966724e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ConfigFiles 3.0 appears to be mangling config.xml

2018-09-04 Thread Benjamin Brummer
I also had to reconfigure one jenkins job, after this update. Configuration 
was gone almost completely. All provided maven settings.xml files where 
gone and but i could set them up again with identical id's.

Am Montag, 3. September 2018 20:14:28 UTC+2 schrieb Michael Weigle:
>
> Upgraded from 2.18 to 3.0
>
> After the upgrade, configs persist on the filesystem inside config.xml 
> until that job is visited in the UI (presumably, config.xml is revalidated 
> at that point and 3.0 throws the error). The attached unreadable_data 
> message also appears in the Manage Old Data section.
>
> Old config.xml shows this comparator:  class="org.jenkinsci.plugins.configfiles.folder.FolderConfigFileProperty$1"/>
> New config.xml shows this comparator:  class="org.jenkinsci.plugins.configfiles.ConfigComparator"/>
>
> I see some commits about pulling ConfigComparator out from where it used 
> to live, but I'm not sure if that's the exact cause of what's going on here.
>
> Thanks,
> Mike
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/6924446a-f129-4d9b-b78a-d824a5e0f9e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


New Node Setup - Trigger Job afterwards

2018-08-24 Thread Benjamin Brummer
Hi,

is there a way to trigger a job after a new node was setup. We have a job 
who writes agent secrets to a nfs share. When the new node boots up it will 
get its secret from this share and connects to the master. Currently we 
trigger this job manually, but i would like to get this done automatically.

BR
Benni

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/81fe968c-dd53-49bf-8c8f-af10ef8bdd97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.