首页 > 解决方案 > Jenkins 单个 git 仓库 多个项目

问题描述

项目代码结构:

$ git clone git@git-server:/data/git/project.git

$ tree -L 1 project
.
├── pushServer
├── README
├── redis_cloud_task
├── Time
├── access
├── business
├── business_client
├── common
├── parent
└── web

$ tree -L 1 project/pushServer/
pushServer/
├── cert
├── config
├── lib
├── pom.xml
├── resource
├── src
└── WebRoot

我应该如何在詹金斯中配置它们?它们都是 java web 项目。

比如配置普通项目时,在jenkins中配置git源只能配置为git@git-server:/data/git/project.git。

行家配置1

行家配置2

建造

Building in workspace /data/srv/tomcat/jenkins/workspace/common
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url git@git-server:/data/git/project.git # timeout=10
Fetching upstream changes from git@git-server:/data/git/project.git
 > git --version # timeout=10
 > git fetch --tags --progress git@git-server:/data/git/project.git +refs/heads/*:refs/remotes/origin/*
 > git rev-parse origin/${branch_tag}^{commit} # timeout=10
 > git rev-parse ${branch_tag}^{commit} # timeout=10
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
Finished: FAILURE

标签: jenkins

解决方案


推荐阅读