continuous integration - GitLab Runner unable to restore nuget packages when started from gitlab but can when started locally -
i trying .net project build , test using gitlab ci.
i have downloaded , installed recent version of gitlab runner , registered our gitlab instance. have created following .gitlab-ci.yaml
file:
variables: solution: performance-validation-tool.sln stages: - build - test # - deploy build: stage: build script: - echo "restoring nuget packages..." - 'c:/nuget/nuget.exe restore' - echo building... - 'msbuild.exe "%solution%"' except: - tags test: stage: test script: - echo testing... - 'msbuild.exe "%solution%"' - dir /s /b *.tests.dll | findstr /r tests\\*\\bin\\ > testcontainers.txt - 'for /f %%f in (testcontainers.txt) mstest.exe /testcontainer:"%%f"' except: - tags
the important part build action.
if run build gitlab following error of nugget packages:
warning: unable find version '3.5.0' of package 'nunit.console'. c:\windows\system32\config\systemprofile\appdata\local\nuget\cache: package 'nunit.console.3.5.0' not found on source 'c:\windows\system32\config\systemprofile\appdata\local\nuget\cache'. https://api.nuget.org/v3/index.json: unable load service index source https://api.nuget.org/v3/index.json. error occurred while sending request. remote name not resolved: 'api.nuget.org'
however if run following command locally:
c:\gitlabrunner\gitlab-ci-multi-runner-windows-amd64.exe exec shell build
everything works perfectly...
i have created firewall exceptions both gitlab runner , nugget.exe (i downloaded , installed recent version of nugget.exe)
the gitlab runner service logged on same account used run manual exec command.
i used same nugget.exe both gitlab triggered builds , manual exec command.
we behind corporate proxy, there no http_proxy environment variable set. proxy configured in "internet options". did try define http_proxy setting nugget.exe later removed after reading nugget.exe uses system proxy default.
thanks in advance help!
i happened @ service in services list , noticed although had explicitly specified user service, created "local system" account, lacked proxy settings, assume. service corrected , builds properly.
Comments
Post a Comment