Submit all custom views after a restart Jenkins

43 views
Skip to first unread message

Jim SERRA

unread,
Oct 16, 2015, 10:35:30 AM10/16/15
to Jenkins Developers
Hello,
I have a plugin which manage custom views and portlets.
I don't if it's possible but I would like to submit automatically all my customs views each time after my server Jenkins restart.

Regards,
Jim.

Robert Sandell

unread,
Oct 16, 2015, 11:20:54 AM10/16/15
to jenkin...@googlegroups.com
But if you add them to Jenkins they should be persisted as well so a restart shouldn't remove them.

/B

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/b90bcf8f-3428-49ab-84ca-b329c7771964%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Robert Sandell
Software Engineer
CloudBees Inc.

Jim SERRA

unread,
Oct 16, 2015, 11:39:24 AM10/16/15
to Jenkins Developers
I don't want to bother you with details but my plugin is not really well developped (I learned by myself), so in short there is some data stored in  json files. 
So I prefer to do this way like that I can add some security in persistance.

The Initializer is quite interesting !
But I don't understand why you link the addView() method is it for the submit purpose?
I never succeeded to do a submit of the view configuration in java.

Robert Sandell

unread,
Oct 16, 2015, 12:01:26 PM10/16/15
to jenkin...@googlegroups.com
Well what I was suggesting was to create your custom view in code and then add it to the ViewGroup (a.k. Jenkins)

Jenkins.getActiveInstance().addView(new MyCustomView(...))

/B


For more options, visit https://groups.google.com/d/optout.

Jim SERRA

unread,
Oct 19, 2015, 5:17:44 AM10/19/15
to Jenkins Developers
Ok,
So if I want to do the apply thing (to update my json files). The best way would be to do in the Initializer a foreach on views and do a deleteView and addView.
I will check that.

Jim SERRA

unread,
Oct 28, 2015, 5:02:54 AM10/28/15
to Jenkins Developers
When I use the Initializer with after/before and whatever InitMilestone when I try to get the list of view with:
jenkins.model.Jenkins.getInstance().getViews();

the list is not initialize yet and doesn't return anything.
Some idea?

Jim,

Robert Sandell

unread,
Oct 28, 2015, 5:47:13 AM10/28/15
to jenkin...@googlegroups.com
have you tried after JOB_LOADED?

/B


For more options, visit https://groups.google.com/d/optout.

Jim SERRA

unread,
Oct 28, 2015, 10:50:30 AM10/28/15
to Jenkins Developers
It works! I must have missed it when I tried :S

Jim,
Reply all
Reply to author
Forward
0 new messages