Hub*_*mas 5 windows-services administrator gitlab-ci gitlab-ci-runner
问题
期望的行为
配置
尝试一下
安装 gitlab-runner 作为https://docs.gitlab.com/runner/install/windows.html推荐的服务
暂时停用用户帐户控制但没有成功
修改了 gitlab-ci.yml 以使用 Powershell 命令调用 vb6.exe、devenv.com 和 msbuild.exe Start-Process -Verb runAs -Wait devenv.com ...,但最终出现错误,devenv.com因为Start-Process似乎只接受以*.exeas 文件结尾的应用程序。devenv.exe正在工作,但未通过 Start-Process 返回/关闭新的终端会话,最终导致挂起的 gitlab-ci-build-script 。此外,构建脚本的终端消息不再可见,因为它们正在由 . 创建的新终端会话中运行Start-Process。
停用 gitlab-runner 服务并通过 Windows 自动启动文件夹启动:运行 Powershell-Script: Start-Process -FilePath D:\development\gitlab-runner\gitlab-runner -ArgumentList 'run --working-directory D:\development\gitlab-runner --config D:\development\gitlab-runner\config.toml --service gitlab-runner --syslog' -Verb runAs -Wait,但配置的用户需要在每次系统启动时登录,这不是构建服务器所需的行为。
gitlab-runner.exe/vb6.exe/devenv.exe/msbuild.exe - 右键单击 - 属性 - 兼容性 - 更改所有用户的设置 - 复选框:以管理员身份运行所有激活的用户 - 未更改所描述的行为
gitlab-ci.yml
stages:
- deploy
variables:
PLATFORM: 'x86'
CONFIGURATION: 'Release'
myproject:
stage: deploy
when: manual
tags: [deploying]
script:
- Start-Process MSBuild.exe -Wait -Verb runAs -Argument 'AutomatedSetupBuild.proj'
- Start-Process devenv.com -Wait -Verb runAs -ArgumentList ".\mysolution.sln /Rebuild `"$CONFIGURATION|$PLATFORM`" /Project .\myproject\myproject.vbproj /ProjectConfig `"$CONFIGURATION|$PLATFORM`" /Log"
- Start-Process vb6.exe -Wait -Verb runAs -ArgumentList "/make `".\vbproject.vbp`" /out `"$env:TEMP/vb6-buildoutput.log`""
Run Code Online (Sandbox Code Playgroud)
小智 0
对我有用的是给我打算安装运行器的用户作为服务登录的权利。转至控制面板 -> 管理工具 -> 本地安全策略 -> 安全设置 -> 本地策略 -> 用户权限分配 -> 作为服务登录。您需要将安装 gitlab-runner 的用户添加到列表中,包括本地域,然后根据https://docs.gitlab.com/runner/install/windows.html安装运行器,同样使用完整用户名与域。