Is there a way to keep Hudson / Jenkins configuration files in source control?

后端 未结 10 823
难免孤独
难免孤独 2020-11-29 15:45

I am new to Hudson / Jenkins and was wondering if there is a way to check in Hudson\'s configuration files to source control.

Ideally I want to be able to click some

10条回答
  •  无人及你
    2020-11-29 16:17

    The way I prefer is to exclude everything in the Jenkins home folder except the configuration files you really want to be in your VCS. Here is the .gitignore file I use:

    *
    !.gitignore
    !/jobs/*/*.xml
    !/*.xml
    !/users/*/config.xml
    !*/
    

    This ignores everything (*) except (!) .gitignore itself, the jobs/projects, the plugin and other important and user configuration files.

    It's also worth considering to include the plugins folder. Annoyingly updated plugins should be included...

    Basically this solution makes it easier for future Jenkins/Hudson updates because new files aren't automatically in scope. You just get on the screeen what you really want.

提交回复
热议问题