简体   繁体   English

Jenkins从Dropbox的git仓库构建

[英]Jenkins build from git repository in Dropbox

I have a main Git bare repository in my Dropbox folder and I'm using a headless Debian server which runs Jenkins to build my projects. 我的Dropbox文件夹中有一个主要的Git裸存储库,并且我使用的是运行Jenkins的无头Debian服务器来构建我的项目。

Until now I've been using this approach to build my projects: I created a bare git repository on my headless server and configured the Jenkins job to pull the sources from this repository with the following URL: /var/cache/git/project . 到目前为止,我一直使用这种方法来构建项目:我在无头服务器上创建了一个裸git仓库,并配置了Jenkins作业以使用以下URL从该仓库中获取源: /var/cache/git/project So when I want Jenkins to build my changes, I have to push them to this repository. 因此,当我希望Jenkins构建更改时,我必须将其推送到此存储库。 This works fine, but it's not very convenient because I have to manually push to two repositories (Dropbox and Debian) and also when I want to add a new project, I need to create a new repository on the Debian server. 这可以正常工作,但不是很方便,因为我必须手动推送到两个存储库(Dropbox和Debian),并且当我要添加新项目时,我需要在Debian服务器上创建一个新存储库。

So I decided to configure the Jenkins jobs to pull directly from the Dropbox repositories. 因此,我决定将Jenkins作业配置为直接从Dropbox存储库中提取。 I've set up Dropbox on my Debian server at /home/jardo/Dropbox . 我已经在Debian服务器上的/home/jardo/Dropbox上设置了/home/jardo/Dropbox

But when I try to configure the Jenkins job to pull drom URL /home/jardo/Dropbox/git/project.git , I get the following error: 但是,当我尝试配置Jenkins作业以提取drom URL /home/jardo/Dropbox/git/project.git ,出现以下错误:

Failed to connect to repository : Command "git ls-remote -h /home/jardo/Dropbox/git/project.git HEAD" returned status code 128: stdout: stderr: fatal: '/home/jardo/Dropbox/git/project.git' does not appear to be a git repository fatal: The remote end hung up unexpectedly 无法连接到存储库:命令“ git ls-remote -h /home/jardo/Dropbox/git/project.git HEAD”返回状态码128:stdout:stderr:致命:'/ home / jardo / Dropbox / git / project .git'似乎不是致命的git存储库:远程端意外挂断

How come Jenkins is able to clone from /var/cache/git/project , but not from my Dropbox folder? Jenkins为何能从/var/cache/git/project克隆,但不能从我的Dropbox文件夹克隆? Dropbox is completely synced and the repository content looks ok. Dropbox已完全同步,并且存储库内容看起来正常。 I've set permissions on the whole repository recursively to 777 and that didn't help. 我已将整个存储库上的权限递归设置为777,这无济于事。

Here is the output of ls -l on my Dropbox repository: 这是我的Dropbox存储库中ls -l的输出:

-rwxrwxrwx   1 jardo jardo  104 Dec 15 21:10 config
-rwxrwxrwx   1 jardo jardo   73 Dec 15 21:10 description
-rwxrwxrwx   1 jardo jardo   23 Dec 15 21:10 HEAD
drwxrwxrwx   2 jardo jardo 4096 Dec 24 13:16 hooks
drwxrwxrwx   2 jardo jardo 4096 Dec 24 13:01 info
drwxrwxrwx 150 jardo jardo 4096 Dec 24 13:01 objects
drwxrwxrwx   4 jardo jardo 4096 Dec 24 12:59 refs

事实证明,即使我尝试将其权限递归设置为777,用户Jenkins也无法访问用户Jardo拥有的GIT存储库。解决方案是也为用户Jenkins设置Dropbox。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM