我在 Windows 上使用 GitLab CI 运行器已经有几年了,我想知道为什么在编译实际完成之后,GitLab 认为工作已经完成需要很长时间。
这里有一些屏幕截图来展示我正在谈论的内容。这表明编译已完成:
MSBuild 已完成,因此构建阶段已完成。31 秒是 MSBuild 完成的时间,但在此之前还需要一分钟左右的时间从 NuGet、Bower 和 NPM 获取包。这是当前作业运行时间的图片:
但随后 GitLab 又在 3 个点上等待了两分钟左右,然后才确定工作实际上已成功:
我打开了 CI_DEBUG_TRACE 但它没有显示出太多对我来说有用的信息。我还尝试过缓存和工件,但将其关闭,因为工件太大并且没有显着改变构建时间。这是 .gitlab-ci.yml 文件:
stages:
- build
- test
before_script:
- '.nuget\\nuget.exe restore <name>.sln'
- 'call bower install'
- 'call npm install'
- 'call gulp'
cache:
build:
stage: build
dependencies: []
script:
- '"C:\\Program Files (x86)\\MSBuild\\14.0\\Bin\\MSBuild.exe" <name>.sln /t:ReBuild /p:Configuration=Release'
retry: 2
test:
stage: test
dependencies: []
script:
- '"C:\\Program Files (x86)\\MSBuild\\14.0\\Bin\\MSBuild.exe" <name>.sln /t:ReBuild /p:Configuration=Release'
- ".\\packages\\xunit.runner.console.2.3.1\\tools\\net452\\xunit.console.exe UnitTest\\bin\\Release\\UnitTest.dll" …Run Code Online (Sandbox Code Playgroud) 下午好。
我在连接到 Postgres 数据库时遇到问题。
我正在开发的应用程序必须在 .NET 4 上运行。我正在使用 Npgsql,因为我仅限于 .NET 4,所以我使用 Npgsql 版本 2.2.7(我相信 3+ 需要 .NET 4.5) )。
该应用程序将与 Postgres 运行在同一台机器上。该数据库是由第三方安装和设置的,因此我无法更改 pg_hba.conf 文件。
我对连接字符串的第一次尝试如下所示:
Server=localhost;Database=xyz;Integrated Security=true;
Run Code Online (Sandbox Code Playgroud)
但我收到了这个错误:
FATAL: 28000: no pg_hba.conf entry for host "::1", user "SYSTEM", database "xyz", SSL off
Run Code Online (Sandbox Code Playgroud)
研究了该错误,并尝试了连接字符串的许多其他变体来修复此问题,包括:
Server=127.0.0.1;Database=xyz;Integrated Security=true;
Server=-h 127.0.0.1;Database=xyz;Integrated Security=true;
Server=127.0.0.1/32;Database=xyz;Integrated Security=true;
Server=::1;Database=xyz;Integrated Security=true;
Server=::1/128;Database=xyz;Integrated Security=true;
Run Code Online (Sandbox Code Playgroud)
但没有任何效果。我要么得到
FATAL: 28000 ...
Run Code Online (Sandbox Code Playgroud)
错误,或者一个简单的
Failed to establish a connection to ...
Run Code Online (Sandbox Code Playgroud)
pg_hba.conf 文件如下所示:
host all postgres 127.0.0.1/32 trust
host all xyz 127.0.0.1/32 trust
host all …Run Code Online (Sandbox Code Playgroud)