简体   繁体   English

詹金斯git无法识别后续推送

[英]jenkins git doesn't recognize subsequent push

I'm trying to use Jenkins on our local git-server to automatically publish new commits to our FTP-Server using git-ftp. 我正在尝试在本地git服务器上使用Jenkins,以使用git-ftp自动将新提交发布到我们的FTP服务器。

The initial upload works, but all subsequent commits are ignored. 初始上传有效,但所有后续提交均被忽略。

I added a Free Style project and in Source-Code-Management, I added the Repo-URL: 我添加了一个自由样式项目,并在“源代码管理”中添加了Repo-URL:

file:////Users/me/my_repository.git

The credentials are blank, since we're on the local filesystem. 凭据为空,因为我们在本地文件系统上。

I don't get any errors in the console-output. 我在控制台输出中没有任何错误。

In the build-setup, I issue the shell command to upload the changed files to my sftp-server: 在构建设置中,我发出shell命令将更改的文件上传到我的sftp服务器:

git ftp push --user $FTP_USER --passwd $FTP_PASS -b dev -vv --auto-init sftp://my.server.tld:22/home/jenkins-test/dev-branch

The initial upload is working perfectly. 初始上传运行良好。 But as soon as I make changes and push them to the repository, Jenkins doesn't see them and claims everything is fine. 但是,一旦我进行更改并将其推送到存储库,Jenkins就不会看到它们,并声称一切都很好。

Any ideas? 有任何想法吗?

[Edit] [编辑]

I found out, that when I delete the initial files on the webserver and do another git ftp push (with --auto-init ), old files are uploaded - and I have no idea where they come from. 我发现,当我删除Web服务器上的初始文件并执行另一个git ftp push(使用--auto-init )时,会上传旧文件-我不知道它们来自何处。

The console-outpout says: 控制台输出说:

Building in workspace /Users/jenkins/.jenkins/workspace/deploy-test-dev

When I check the files in this directory, they are the ones with the changes made in the last commit. 当我检查此目录中的文件时,它们就是在最后一次提交中所做的更改的文件。 Alas, they aren't the ones that are being uploaded to the ftp-server. las,它们不是要上传到ftp服务器的文件。

Is there some kind of caching going on??? 是否有某种正在进行的缓存???

Perhaps you are missing Build Triggers in the job configuration? 也许您在作业配置中缺少构建触发器

Because your repository is located on local file-system, you should probably use Poll SCM trigger or FSTrigger Plugin . 因为您的存储库位于本地文件系统上,所以您可能应该使用Poll SCM触发器或FSTrigger插件

The problem was the push-command. 问题是推送命令。

instead of 代替

git ftp push --user $FTP_USER --passwd $FTP_PASS -b dev -vv --auto-init sftp://my.server.tld:22/home/jenkins-test/dev-branch

I had to delete the -b dev (since there isn't any dev-branch after the checkout). 我不得不删除-b dev(因为签出后没有任何dev分支)。

So this works 所以这有效

git ftp push --user $FTP_USER --passwd $FTP_PASS -vv --auto-init sftp://my.server.tld:22/home/jenkins-test/dev-branch

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

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