Help us learn about your current experience with the documentation. Take the survey.
Windows 上的托管运行器
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com
- Status: Beta
Windows 上的托管运行器通过在 Google Cloud Platform 上启动虚拟机来自动扩展。该解决方案使用了 GitLab 为 custom executor 开发的 autoscaling driver。Windows 上的托管运行器处于 beta 阶段。
我们希望持续迭代,使 Windows 运行器达到稳定状态并实现 generally available。你可以通过 related epic 跟踪我们为实现这一目标所做的工作。
Windows 可用的机器类型
GitLab 为 Windows 上的托管运行器提供以下机器类型。
| Runner 标签 | vCPUs | 内存 | 存储 |
|---|---|---|---|
saas-windows-medium-amd64 |
2 | 7.5 GB | 75 GB |
支持的 Windows 版本
Windows 运行器虚拟机实例不使用 GitLab Docker executor。这意味着你无法在流水线配置中指定 image 或 services。
你可以在以下 Windows 版本中执行你的任务:
| 版本 | 状态 |
|---|---|
| Windows 2022 | GA |
你可以在 pre-installed software documentation 中找到可用预装软件的完整列表。
支持的 shell
Windows 上的托管运行器已配置 PowerShell 作为 shell。因此,你的 .gitlab-ci.yml 文件中的 script 部分需要使用 PowerShell 命令。
示例 .gitlab-ci.yml 文件
使用以下示例 .gitlab-ci.yml 文件开始使用 Windows 上的托管运行器:
.windows_job:
tags:
- saas-windows-medium-amd64
before_script:
- Set-Variable -Name "time" -Value (date -Format "%H:%m")
- echo ${time}
- echo "started by ${GITLAB_USER_NAME} / @${GITLAB_USER_LOGIN}"
build:
extends:
- .windows_job
stage: build
script:
- echo "running scripts in the build job"
test:
extends:
- .windows_job
stage: test
script:
- echo "running scripts in the test job"