jenkin + Git submodule automatic pulling Code

jenkins + Git submodule automatic pulling Code

Add Git submodules
first cloned want to add warehouse sub-module git clone ssh://git@ip:port/user/project.git, this is your home directory.

Into the warehouse, adding sub-module git submodule add ssh://git@ip:port/user/project.git, and the main warehouse are different.

lsView, there will be .gitmodulesthe project name and the sub-modules.

The generated files and directories push to the main repository.

Cloning warehouse submodule

Adding too warehouse sub-module, if you want to re-cloning, and general cloning the same, but after cloning should be executed in the warehouse catalog
git submodule initand git submodule update, if not executed, sub-modules will be no files.

Change the sub-module branch

To switch to the directory module, sub-module is a default master branch git submodule foreach git checkout dev,
then git submodule foreach git pullbranch switching.

Necessary jenkinstasks 构建步骤added git submodule initand git submodule update, and said operation (a write command in the latter two),
jenkinsin order to pull the code.

submodule can tag and merge

git submodule foreachMay each sub-module is operating, so that all sub-modules tagand mergeoperations equivalent to total items corresponding operation.

Guess you like

Origin www.cnblogs.com/zzhaolei/p/11067992.html