I've found it much easier to copy the configuration files into the "ref" directory structure of the Docker instance, rather than trying to write scripts which perform the same actions.
If you'd like to see an example of the technique, look at https://github.com/MarkEWaite/docker-lfs/tree/lts-with-plugins/ref for some of the configuration files that I've captured from my Jenkins installations. Mark Waite On Thu, Mar 16, 2017 at 8:35 AM Art <[email protected]> wrote: > Hi, > > I am trying to auto-configure my Jenkins environment. > > I started with the base Jenkins Docker Image (Alpine) and installing my > plugins via install-plugins.sh script. > I am adding a pipeline job, a agent (slave) node, and setting some global > variables. > > What I am having trouble with is how to configure the global settings of a > plugin. I have seen some examples of managing tools, but I'm not clear on > how to choose/verify the package/class to use for the plugin. > > Here is my Dockerfile: > > FROM jenkins:2.32.3-alpine > > ENV JAVA_OPTS '-Djenkins.install.runSetupWizard=false' > > COPY init.groovy.d/* /usr/share/jenkins/ref/init.groovy.d/ > > ## Install required plugins (auto installs dependencies) > RUN /usr/local/bin/install-plugins.sh \ > config-file-provider \ > credentials-binding \ > docker-workflow \ > git \ > gitlab-plugin \ > job-dsl \ > parameterized-trigger \ > ssh-agent \ > ssh-slaves \ > workflow-aggregator > > > The two items I am trying to configure is my `Gitlab` connection > information and my `Pipeline Global Library` > > For the Gitlab plugin this is how I'm starting, but not sure if it's the > right direction. > > import jenkins.model.* > > def instance = Jenkins.getInstance() > // Is this the right class? or do I need to do something entirely different? > def gitlab = > instance.getExtensionList(com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty.DescriptorImpl.class) > // TODO: set settings on gitlab and assign credentials by id. > > For the Pipeline Global Library, I'm not even sure how to start with that > one. > > Any help would be greatly appreciated. > > Cheers! > > Art > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-dev/11020095-0f75-47e3-852b-092b3eb037e2%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-dev/11020095-0f75-47e3-852b-092b3eb037e2%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAO49JtHyXcZ6-O293V_-aw8iuMkSgb%3DyiLvCpG-SqZ1f9AJFcw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
