Jenkins Windows Slave忽略本地Git设置 [英] Jenkins Windows Slave ignoring local Git settings

查看:106
本文介绍了Jenkins Windows Slave忽略本地Git设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将Windows Jenkins从属服务器设置为Unix Jenkins主服务器.我正在使用msysgit 1.9.5和Jenkins 1.616运行Windows 8.1.

I've setup a Windows Jenkins slave to a Unix Jenkins master. I'm running Windows 8.1 with msysgit 1.9.5 and Jenkins 1.616.

当签出路径/文件名超过255个字符的存储库时,出现文件名太长"错误.通过在git设置中将core.longpaths设置为true,可以解决.但是Windows Jenkins从属服务器忽略了自定义设置,而是使用标准设置.

When checking out a repository with path/filename longer than 255 characters, I get the "Filename too long" error. This is solved by setting core.longpaths to true in the git settings. However the Windows Jenkins slave is ignoring the custom settings and uses standard settings.

我尝试过的事情

  • 在Windows Jenkins从属服务器上以全局,系统,本地设置设置core.longpaths:

git config --global core.longpaths true
git config --system core.longpaths true
git config --local core.longpaths true

  • 在Unix Jenkins Master上设置core.longpaths

    结果

    Windows Jenkins从属服务器仍在使用默认设置运行git.我已经使用

    The Windows Jenkins slave is still running git with default settings. I've made a simple build task with

    "C:\Program Files (x86)\Git\bin\git.exe" config -l
    

    产生

    Started by user mles
    [EnvInject] - Loading node environment variables.
    Building remotely on jw10 in workspace D:\workspace\windowstesting
    [windowstesting] $ sh -xe C:\WINDOWS\TEMP\hudson2817786906482449008.sh
    + 'C:\Program Files (x86)\Git\bin\git.exe' config -l
    core.symlinks=false
    core.autocrlf=true
    color.diff=auto
    color.status=auto
    color.branch=auto
    color.interactive=true
    pack.packsizelimit=2g
    help.format=html
    http.sslcainfo=/bin/curl-ca-bundle.crt
    sendemail.smtpserver=/bin/msmtp.exe
    diff.astextplain.textconv=astextplain
    rebase.autosquash=true
    Finished: SUCCESS
    

    请注意core.longpaths=true.在Windows Jenkins从属服务器上,设置了core.longpaths=true

    note no core.longpaths=true. On the Windows Jenkins slave core.longpaths=true is set

    C:\Users\jw>git config -l
    core.symlinks=false
    core.autocrlf=true
    core.longpaths=true
    color.diff=auto
    color.status=auto
    color.branch=auto
    color.interactive=true
    pack.packsizelimit=2g
    help.format=html
    http.sslcainfo=/bin/curl-ca-bundle.crt
    sendemail.smtpserver=/bin/msmtp.exe
    diff.astextplain.textconv=astextplain
    rebase.autosquash=true
    

    有效的方法

    在没有Jenkins的Windows Jenkins从属服务器上,在本地 上克隆路径/文件名非常长的存储库.

    Cloning a repository with very long path/filenames locally on the Windows Jenkins slave without Jenkins.

    什么不起作用

    在Windows Jenkins从属服务器 with Jenkins上用非常长的路径/文件名克隆相同的存储库

    Cloning the same repository with very long path/filenames on the Windows Jenkins slave with Jenkins

        Started by user mles
        [EnvInject] - Loading node environment variables.
        Building remotely on jw10 in workspace D:\workspace\windowstesting
        Cloning the remote Git repository
        Cloning repository https://github.com/axelhodler/longfile.git
         > git init D:\workspace\windowstesting # timeout=10
        Fetching upstream changes from https://github.com/axelhodler/longfile.git
         > git --version # timeout=10
         > git -c core.askpass=true fetch --tags --progress https://github.com/axelhodler/longfile.git +refs/heads/*:refs/remotes/origin/*
         > git config remote.origin.url https://github.com/axelhodler/longfile.git # timeout=10
         > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
         > git config remote.origin.url https://github.com/axelhodler/longfile.git # timeout=10
        Fetching upstream changes from https://github.com/axelhodler/longfile.git
         > git -c core.askpass=true fetch --tags --progress https://github.com/axelhodler/longfile.git +refs/heads/*:refs/remotes/origin/*
         > git rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
         > git rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
        Checking out Revision 31b408748324aa6f361828e45ae1d374c3f0fc25 (refs/remotes/origin/master)
         > git config core.sparsecheckout # timeout=10
         > git checkout -f 31b408748324aa6f361828e45ae1d374c3f0fc25
        FATAL: Could not checkout null with start point 31b408748324aa6f361828e45ae1d374c3f0fc25
        hudson.plugins.git.GitException: Could not checkout null with start point 31b408748324aa6f361828e45ae1d374c3f0fc25
           ...
        Caused by: hudson.plugins.git.GitException: Command "git checkout -f 31b408748324aa6f361828e45ae1d374c3f0fc25" returned status code 128:
        stdout: 
        stderr: fatal: cannot create directory at 'launchpad/projects/configurationAdminManager/gofer-configurationAdminManager-notification/src/com/mwaysolutions/gofer2/configurationAdminManager/notification/dummydummy/dummydummy/dummydummy/dummydummy/dummydummy/dummydummy': Filename too long
           ....
        Finished: FAILURE
    

    我不能在开始时添加另一个构建步骤来设置core.longpaths,因为签出存储库是jenkins在运行任何构建步骤之前要做的第一件事.

    I can not add another build step at the beginning to set core.longpaths, as checking out the repository is the first thing jenkins does before running any build steps.

    为什么我的Windows Jenkins从属设备会忽略自定义设置?

    Any ideas why custom settings are ignored by my Windows Jenkins slave?

    推荐答案

    Jenkins从属服务器应以用户jw身份运行.这将使git拾取您为此用户输入的所有设置.
    如果作为服务运行,请将该服务更新为以用户jw而不是系统用户身份运行.

    Jenkins slave should be running as user jw. This will make git pick up all the settings you put in for this user.
    If running as a service, update the service to run as user jw and not as system user.

    我希望这会有所帮助.

    这篇关于Jenkins Windows Slave忽略本地Git设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆