azure-pipelines by microsoft/vscode
npx skills add https://github.com/microsoft/vscode --skill azure-pipelines在修改 Azure DevOps 流水线文件(build/azure-pipelines/ 目录中的 YAML 文件)时,你可以在提交前使用 Azure CLI 在本地验证变更。这避免了推送变更、等待 CI 运行并检查结果的缓慢反馈循环。
检查是否已安装 Azure CLI:
az --version
如果未安装,请安装它:
# macOS
brew install azure-cli
# Windows (以管理员身份运行 PowerShell)
winget install Microsoft.AzureCLI
# Linux (Debian/Ubuntu)
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
2. 检查是否已安装 DevOps 扩展:
az extension show --name azure-devops
如果未安装,请添加它:
az extension add --name azure-devops
3. 身份验证:
az login
az devops configure --defaults organization=https://dev.azure.com/monacotools project=Monaco
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
主要的 VS Code 构建流水线:
monacotoolsMonaco111有两个 Insider 构建会按计划自动运行:
这些定时构建使用相同的流水线定义(111),但在 main 分支上运行以生成 Insider 版本。
使用 queue 命令 来排队一个验证构建:
# 在当前分支上排队构建
node .github/skills/azure-pipelines/azure-pipeline.ts queue
# 使用指定的源分支排队
node .github/skills/azure-pipelines/azure-pipeline.ts queue --branch my-feature-branch
# 使用自定义参数排队
node .github/skills/azure-pipelines/azure-pipeline.ts queue --parameter "VSCODE_BUILD_WEB=false" --parameter "VSCODE_PUBLISH=false"
# 参数值包含空格
node .github/skills/azure-pipelines/azure-pipeline.ts queue --parameter "VSCODE_BUILD_TYPE=Product Build"
重要:在排队新构建之前,请取消同一分支上你不再需要的任何先前构建。这可以释放构建代理并减少资源浪费:
# 从状态中查找构建 ID,然后取消它 node .github/skills/azure-pipelines/azure-pipeline.ts status node .github/skills/azure-pipelines/azure-pipeline.ts cancel --build-id <id> node .github/skills/azure-pipelines/azure-pipeline.ts queue
| 选项 | 描述 |
|---|---|
--branch <name> | 要构建的源分支(默认:当前 git 分支) |
--definition <id> | 流水线定义 ID(默认:111) |
--parameter <entry> | 格式为 KEY=value 的流水线参数(可重复);当值包含空格时使用此选项 |
--parameters <list> | 格式为 KEY=value KEY2=value2 的空格分隔参数;值不能包含空格 |
--dry-run | 打印命令但不执行 |
build/azure-pipelines/product-build.yml)| 名称 | 类型 | 默认值 | 允许值 | 描述 |
|---|---|---|---|---|
VSCODE_QUALITY | string | insider | exploration, insider, stable | 构建质量通道 |
VSCODE_BUILD_TYPE | string | Product Build | Product, CI | 产品构建与 CI 的构建模式 |
NPM_REGISTRY | string | https://pkgs.dev.azure.com/monacotools/Monaco/_packaging/vscode/npm/registry/ | 任意 URL | 自定义 npm 注册表 |
CARGO_REGISTRY | string | sparse+https://pkgs.dev.azure.com/monacotools/Monaco/_packaging/vscode/Cargo/index/ | 任意 URL | 自定义 Cargo 注册表 |
VSCODE_BUILD_WIN32 | boolean | true | true, false | 构建 Windows x64 |
VSCODE_BUILD_WIN32_ARM64 | boolean | true | true, false | 构建 Windows arm64 |
VSCODE_BUILD_LINUX | boolean | true | true, false | 构建 Linux x64 |
VSCODE_BUILD_LINUX_SNAP | boolean | true | true, false | 构建 Linux x64 Snap |
VSCODE_BUILD_LINUX_ARM64 | boolean | true | true, false | 构建 Linux arm64 |
VSCODE_BUILD_LINUX_ARMHF | boolean | true | true, false | 构建 Linux armhf |
VSCODE_BUILD_ALPINE | boolean | true | true, false | 构建 Alpine x64 |
VSCODE_BUILD_ALPINE_ARM64 | boolean | true | true, false | 构建 Alpine arm64 |
VSCODE_BUILD_MACOS | boolean | true | true, false | 构建 macOS x64 |
VSCODE_BUILD_MACOS_ARM64 | boolean | true | true, false | 构建 macOS arm64 |
VSCODE_BUILD_MACOS_UNIVERSAL | boolean | true | true, false | 构建 macOS 通用版(需要两个 macOS 架构) |
VSCODE_BUILD_WEB | boolean | true | true, false | 构建 Web 构件 |
VSCODE_PUBLISH | boolean | true | true, false | 发布到 builds.code.visualstudio.com |
VSCODE_RELEASE | boolean | false | true, false | 如果成功则触发发布流程 |
VSCODE_STEP_ON_IT | boolean | false | true, false | 跳过测试 |
示例:运行一个快速的、面向 CI 的验证,将发布/发布的副作用降至最低:
node .github/skills/azure-pipelines/azure-pipeline.ts queue \
--parameter "VSCODE_BUILD_TYPE=CI Build" \
--parameter "VSCODE_PUBLISH=false" \
--parameter "VSCODE_RELEASE=false"
使用 status 命令 来监控正在运行的构建:
# 获取最近构建的状态
node .github/skills/azure-pipelines/azure-pipeline.ts status
# 按 ID 获取特定构建的概览
node .github/skills/azure-pipelines/azure-pipeline.ts status --build-id 123456
# 监视构建状态(每 30 秒刷新一次)
node .github/skills/azure-pipelines/azure-pipeline.ts status --watch
# 使用自定义间隔(60 秒)监视
node .github/skills/azure-pipelines/azure-pipeline.ts status --watch 60
| 选项 | 描述 |
|---|---|
--build-id <id> | 特定的构建 ID(默认:当前分支上最近的构建) |
--branch <name> | 按分支名称过滤构建(显示分支的最后 20 个构建) |
--reason <reason> | 按原因过滤构建:manual, individualCI, batchedCI, schedule, pullRequest |
--definition <id> | 流水线定义 ID(默认:111) |
--watch [seconds] | 持续轮询状态直到构建完成(默认:30 秒) |
--download-log <id> | 将特定日志下载到 /tmp |
--download-artifact <name> | 将构件下载到 /tmp |
--json | 输出原始 JSON 以供程序化使用 |
使用 cancel 命令 来停止正在运行的构建:
# 按 ID 取消构建(使用 status 命令查找 ID)
node .github/skills/azure-pipelines/azure-pipeline.ts cancel --build-id 123456
# 试运行(显示将要取消的内容)
node .github/skills/azure-pipelines/azure-pipeline.ts cancel --build-id 123456 --dry-run
| 选项 | 描述 |
|---|---|
--build-id <id> | 要取消的构建 ID(必需) |
--definition <id> | 流水线定义 ID(默认:111) |
--dry-run | 打印将要取消的内容但不执行 |
当用户要求在 Azure Pipelines 构建中测试变更时,请遵循此工作流程:
使用带有 sleep 的 shell 循环来轮询构建状态。sleep 命令在所有主要操作系统上都有效:
# 排队构建并从输出中记下构建 ID(例如 123456)
node .github/skills/azure-pipelines/azure-pipeline.ts queue
# 每 60 秒轮询一次直到完成(适用于 macOS、Linux 和带有 Git Bash/WSL 的 Windows)
# 将 <BUILD_ID> 替换为 queue 命令返回的实际构建 ID
while true; do
node .github/skills/azure-pipelines/azure-pipeline.ts status --build-id <BUILD_ID> --json 2>/dev/null | grep -q '"status": "completed"' && break
sleep 60
done
# 检查最终结果
node .github/skills/azure-pipelines/azure-pipeline.ts status --build-id <BUILD_ID>
或者,使用内置的 --watch 标志,它会自动处理轮询:
node .github/skills/azure-pipelines/azure-pipeline.ts queue
# 使用 queue 命令返回的构建 ID
node .github/skills/azure-pipelines/azure-pipeline.ts status --build-id <BUILD_ID> --watch
注意:
--watch标志默认每 30 秒轮询一次。使用--watch 60可以设置 60 秒的间隔以减少 API 调用。
# 进行 YAML 更改,然后:
git add -A && git commit -m "test: pipeline changes"
git push origin HEAD
# 检查此分支上是否有任何先前的构建,并在需要时取消
node .github/skills/azure-pipelines/azure-pipeline.ts status
node .github/skills/azure-pipelines/azure-pipeline.ts cancel --build-id <id> # 如果存在活跃的构建
# 排队并监视新构建
node .github/skills/azure-pipelines/azure-pipeline.ts queue
node .github/skills/azure-pipelines/azure-pipeline.ts status --watch
# 获取构建概览(显示阶段、构件和日志 ID)
node .github/skills/azure-pipelines/azure-pipeline.ts status --build-id 123456
# 下载特定日志进行深入检查
node .github/skills/azure-pipelines/azure-pipeline.ts status --build-id 123456 --download-log 5
# 下载构件
node .github/skills/azure-pipelines/azure-pipeline.ts status --build-id 123456 --download-artifact unsigned_vscode_cli_win32_x64_cli
# 自定义构建矩阵以进行更快的验证
node .github/skills/azure-pipelines/azure-pipeline.ts queue \
--parameter "VSCODE_BUILD_TYPE=CI Build" \
--parameter "VSCODE_BUILD_WEB=false" \
--parameter "VSCODE_BUILD_ALPINE=false" \
--parameter "VSCODE_BUILD_ALPINE_ARM64=false" \
--parameter "VSCODE_PUBLISH=false"
# 首先,找到构建 ID
node .github/skills/azure-pipelines/azure-pipeline.ts status
# 按 ID 取消特定构建
node .github/skills/azure-pipelines/azure-pipeline.ts cancel --build-id 123456
# 试运行以查看将要取消的内容
node .github/skills/azure-pipelines/azure-pipeline.ts cancel --build-id 123456 --dry-run
在迭代流水线 YAML 变更时,总是在排队新构建之前取消过时的构建:
# 推送新变更
git add -A && git commit --amend --no-edit
git push --force-with-lease origin HEAD
# 找到过时的构建 ID 并取消它
node .github/skills/azure-pipelines/azure-pipeline.ts status
node .github/skills/azure-pipelines/azure-pipeline.ts cancel --build-id <id>
# 排队一个新的构建并监控
node .github/skills/azure-pipelines/azure-pipeline.ts queue
node .github/skills/azure-pipelines/azure-pipeline.ts status --watch
# 重新进行身份验证
az logout
az login
# 检查当前账户
az account show
az extension add --name azure-devops --upgrade
如果遇到速率限制,请在 API 调用之间添加延迟,或者使用更长时间间隔的 --watch。
每周安装数
212
仓库
GitHub Stars
183.0K
首次出现
2026年2月19日
安全审计
安装于
opencode212
codex212
gemini-cli211
kimi-cli211
github-copilot211
amp211
When modifying Azure DevOps pipeline files (YAML files in build/azure-pipelines/), you can validate changes locally using the Azure CLI before committing. This avoids the slow feedback loop of pushing changes, waiting for CI, and checking results.
Check if Azure CLI is installed :
az --version
If not installed, install it:
# macOS
brew install azure-cli
# Windows (PowerShell as Administrator)
winget install Microsoft.AzureCLI
# Linux (Debian/Ubuntu)
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
2. Check if the DevOps extension is installed :
az extension show --name azure-devops
If not installed, add it:
az extension add --name azure-devops
3. Authenticate :
az login
az devops configure --defaults organization=https://dev.azure.com/monacotools project=Monaco
The main VS Code build pipeline:
monacotoolsMonaco111Two Insider builds run automatically on a scheduled basis:
These scheduled builds use the same pipeline definition (111) but run on the main branch to produce Insider releases.
Use the queue command to queue a validation build:
# Queue a build on the current branch
node .github/skills/azure-pipelines/azure-pipeline.ts queue
# Queue with a specific source branch
node .github/skills/azure-pipelines/azure-pipeline.ts queue --branch my-feature-branch
# Queue with custom parameters
node .github/skills/azure-pipelines/azure-pipeline.ts queue --parameter "VSCODE_BUILD_WEB=false" --parameter "VSCODE_PUBLISH=false"
# Parameter value with spaces
node .github/skills/azure-pipelines/azure-pipeline.ts queue --parameter "VSCODE_BUILD_TYPE=Product Build"
Important : Before queueing a new build, cancel any previous builds on the same branch that you no longer need. This frees up build agents and reduces resource waste:
# Find the build ID from status, then cancel it node .github/skills/azure-pipelines/azure-pipeline.ts status node .github/skills/azure-pipelines/azure-pipeline.ts cancel --build-id <id> node .github/skills/azure-pipelines/azure-pipeline.ts queue
| Option | Description |
|---|---|
--branch <name> | Source branch to build (default: current git branch) |
--definition <id> | Pipeline definition ID (default: 111) |
--parameter <entry> | Pipeline parameter in KEY=value format (repeatable); use this when the value contains spaces |
--parameters <list> | Space-separated parameters in KEY=value KEY2=value2 format; values must not contain spaces |
build/azure-pipelines/product-build.yml)| Name | Type | Default | Allowed Values | Description |
|---|---|---|---|---|
VSCODE_QUALITY | string | insider | exploration, insider, stable | Build quality channel |
VSCODE_BUILD_TYPE | string | Product Build |
Example: run a quick CI-oriented validation with minimal publish/release side effects:
node .github/skills/azure-pipelines/azure-pipeline.ts queue \
--parameter "VSCODE_BUILD_TYPE=CI Build" \
--parameter "VSCODE_PUBLISH=false" \
--parameter "VSCODE_RELEASE=false"
Use the status command to monitor a running build:
# Get status of the most recent builds
node .github/skills/azure-pipelines/azure-pipeline.ts status
# Get overview of a specific build by ID
node .github/skills/azure-pipelines/azure-pipeline.ts status --build-id 123456
# Watch build status (refreshes every 30 seconds)
node .github/skills/azure-pipelines/azure-pipeline.ts status --watch
# Watch with custom interval (60 seconds)
node .github/skills/azure-pipelines/azure-pipeline.ts status --watch 60
| Option | Description |
|---|---|
--build-id <id> | Specific build ID (default: most recent on current branch) |
--branch <name> | Filter builds by branch name (shows last 20 builds for branch) |
--reason <reason> | Filter builds by reason: manual, individualCI, batchedCI, schedule, pullRequest |
Use the cancel command to stop a running build:
# Cancel a build by ID (use status command to find IDs)
node .github/skills/azure-pipelines/azure-pipeline.ts cancel --build-id 123456
# Dry run (show what would be cancelled)
node .github/skills/azure-pipelines/azure-pipeline.ts cancel --build-id 123456 --dry-run
| Option | Description |
|---|---|
--build-id <id> | Build ID to cancel (required) |
--definition <id> | Pipeline definition ID (default: 111) |
--dry-run | Print what would be cancelled without executing |
When the user asks to test changes in an Azure Pipelines build , follow this workflow:
Use a shell loop with sleep to poll the build status. The sleep command works on all major operating systems:
# Queue the build and note the build ID from output (e.g., 123456)
node .github/skills/azure-pipelines/azure-pipeline.ts queue
# Poll every 60 seconds until complete (works on macOS, Linux, and Windows with Git Bash/WSL)
# Replace <BUILD_ID> with the actual build ID from the queue command
while true; do
node .github/skills/azure-pipelines/azure-pipeline.ts status --build-id <BUILD_ID> --json 2>/dev/null | grep -q '"status": "completed"' && break
sleep 60
done
# Check final result
node .github/skills/azure-pipelines/azure-pipeline.ts status --build-id <BUILD_ID>
Alternatively, use the built-in --watch flag which handles polling automatically:
node .github/skills/azure-pipelines/azure-pipeline.ts queue
# Use the build ID returned by the queue command
node .github/skills/azure-pipelines/azure-pipeline.ts status --build-id <BUILD_ID> --watch
Note : The
--watchflag polls every 30 seconds by default. Use--watch 60for a 60-second interval to reduce API calls.
# Make your YAML changes, then:
git add -A && git commit -m "test: pipeline changes"
git push origin HEAD
# Check for any previous builds on this branch and cancel if needed
node .github/skills/azure-pipelines/azure-pipeline.ts status
node .github/skills/azure-pipelines/azure-pipeline.ts cancel --build-id <id> # if there's an active build
# Queue and watch the new build
node .github/skills/azure-pipelines/azure-pipeline.ts queue
node .github/skills/azure-pipelines/azure-pipeline.ts status --watch
# Get overview of a build (shows stages, artifacts, and log IDs)
node .github/skills/azure-pipelines/azure-pipeline.ts status --build-id 123456
# Download a specific log for deeper inspection
node .github/skills/azure-pipelines/azure-pipeline.ts status --build-id 123456 --download-log 5
# Download an artifact
node .github/skills/azure-pipelines/azure-pipeline.ts status --build-id 123456 --download-artifact unsigned_vscode_cli_win32_x64_cli
# Customize build matrix for quicker validation
node .github/skills/azure-pipelines/azure-pipeline.ts queue \
--parameter "VSCODE_BUILD_TYPE=CI Build" \
--parameter "VSCODE_BUILD_WEB=false" \
--parameter "VSCODE_BUILD_ALPINE=false" \
--parameter "VSCODE_BUILD_ALPINE_ARM64=false" \
--parameter "VSCODE_PUBLISH=false"
# First, find the build ID
node .github/skills/azure-pipelines/azure-pipeline.ts status
# Cancel a specific build by ID
node .github/skills/azure-pipelines/azure-pipeline.ts cancel --build-id 123456
# Dry run to see what would be cancelled
node .github/skills/azure-pipelines/azure-pipeline.ts cancel --build-id 123456 --dry-run
When iterating on pipeline YAML changes, always cancel obsolete builds before queueing new ones:
# Push new changes
git add -A && git commit --amend --no-edit
git push --force-with-lease origin HEAD
# Find the outdated build ID and cancel it
node .github/skills/azure-pipelines/azure-pipeline.ts status
node .github/skills/azure-pipelines/azure-pipeline.ts cancel --build-id <id>
# Queue a fresh build and monitor
node .github/skills/azure-pipelines/azure-pipeline.ts queue
node .github/skills/azure-pipelines/azure-pipeline.ts status --watch
# Re-authenticate
az logout
az login
# Check current account
az account show
az extension add --name azure-devops --upgrade
If you hit rate limits, add delays between API calls or use --watch with a longer interval.
Weekly Installs
212
Repository
GitHub Stars
183.0K
First Seen
Feb 19, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode212
codex212
gemini-cli211
kimi-cli211
github-copilot211
amp211
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
114,200 周安装
--dry-run |
| Print the command without executing |
Product, CI |
| Build mode for Product vs CI |
NPM_REGISTRY | string | https://pkgs.dev.azure.com/monacotools/Monaco/_packaging/vscode/npm/registry/ | any URL | Custom npm registry |
CARGO_REGISTRY | string | sparse+https://pkgs.dev.azure.com/monacotools/Monaco/_packaging/vscode/Cargo/index/ | any URL | Custom Cargo registry |
VSCODE_BUILD_WIN32 | boolean | true | true, false | Build Windows x64 |
VSCODE_BUILD_WIN32_ARM64 | boolean | true | true, false | Build Windows arm64 |
VSCODE_BUILD_LINUX | boolean | true | true, false | Build Linux x64 |
VSCODE_BUILD_LINUX_SNAP | boolean | true | true, false | Build Linux x64 Snap |
VSCODE_BUILD_LINUX_ARM64 | boolean | true | true, false | Build Linux arm64 |
VSCODE_BUILD_LINUX_ARMHF | boolean | true | true, false | Build Linux armhf |
VSCODE_BUILD_ALPINE | boolean | true | true, false | Build Alpine x64 |
VSCODE_BUILD_ALPINE_ARM64 | boolean | true | true, false | Build Alpine arm64 |
VSCODE_BUILD_MACOS | boolean | true | true, false | Build macOS x64 |
VSCODE_BUILD_MACOS_ARM64 | boolean | true | true, false | Build macOS arm64 |
VSCODE_BUILD_MACOS_UNIVERSAL | boolean | true | true, false | Build macOS universal (requires both macOS arches) |
VSCODE_BUILD_WEB | boolean | true | true, false | Build Web artifacts |
VSCODE_PUBLISH | boolean | true | true, false | Publish to builds.code.visualstudio.com |
VSCODE_RELEASE | boolean | false | true, false | Trigger release flow if successful |
VSCODE_STEP_ON_IT | boolean | false | true, false | Skip tests |
--definition <id> | Pipeline definition ID (default: 111) |
--watch [seconds] | Continuously poll status until build completes (default: 30s) |
--download-log <id> | Download a specific log to /tmp |
--download-artifact <name> | Download artifact to /tmp |
--json | Output raw JSON for programmatic consumption |