Resurrecting a Backup to SCM structure - with Jenkinsfile and Agents

7 views
Skip to first unread message

Randall Becker

unread,
Dec 25, 2018, 2:42:44 PM12/25/18
to Jenkins Users
Hi All,

Following best practices, we moved our entire build structure to a per-project Jenkinsfile and agents where the various parts of builds happen. The Jenkinsfiles are stored in the git repositories involved and we are using multi-branch projects. All that is working file.

Our issue is that our Jenkins runs inside docker and the node configuration, certificates, and Jenkins system configuration is not yet stored in an SCM environment. We want that to happen so that we can restore Jenkins quickly from scratch if something happens, without having to go through the trouble of recreating the Agent structure from scratch and redefining the multibranch jobs. We've had a newbie or two (me as an example) accidentally blow out the docker config and lost our Jenkins Agent structure.

It seems like the Configuration-as-Code plugin might work, but it is hard to get a sense that this can configure Jenkins in its entirety or whether we can take the existing configuration and import/convert it to that plugin, and how config moves in and out of it.

Any Sense of this?

Thanks,
Randall

Mark Waite

unread,
Dec 25, 2018, 10:08:38 PM12/25/18
to Jenkins Users
I use a private docker image for rapid Jenkins test setup and teardown.  In that private image, I place copies of relevant files in the "ref/" directory.  That allows me to copy credentials, job definitions, folder definitions, etc.

I plan to eventually move away from that technique since it embeds credentials into my Docker image, but I haven't found the next technique.  I suspect it will involve storing the credentials in the Kubernetes credentials store rather than placing them in the docker repo.

Mark Waite
Reply all
Reply to author
Forward
0 new messages