実行は TeamCity におけるビルド実行を表します。teamcity run コマンドグループを使用すると、ビルドの開始、リアルタイムでの監視、ログとテスト結果の表示、アーティファクトの管理、タグ、コメント、ピンによる実行の整理を行うことができます。
実行の一覧表示
teamcity run list の最近のビルドを表示:
teamcity run list
お気に入りの実行コース
teamcity run list --favorites を使用すると、現在ユーザーがお気に入りのビルドが表示されます。これには、手動でスターを付けたビルドや、TeamCity で重要としてマークしたビルドが含まれます。
teamcity run list --favorites
teamcity run list --favorites --status failure --limit 10
--favorites は、既存の run list のフィルターおよび出力モードと互換性があります。
フィルター
フラグを使用して結果を絞り込みます。
# Builds for a specific job
teamcity run list --job MyProject_Build
# Filter by project
teamcity run list --project MyProject
# Filter by branch
teamcity run list --branch main
# Auto-detect the current git branch
teamcity run list --branch @this
# Filter by status
teamcity run list --status failure
# Show only your favorite builds
teamcity run list --favorites
# Show only your own recent builds
teamcity run list --user @me
# Show only the latest matching run
teamcity run list --user @me --branch @this --limit 1
# Filter by user who triggered the build
teamcity run list --user alice
teamcity run list --user @me
# Combine filters
teamcity run list --job MyProject_Build --status failure --branch main
リビジョンによるフィルタリング
--revision を使用して、特定の VCS コミットを含むすべてのビルドを検索します。
# All builds for a commit
teamcity run list --revision abc1234
# Scoped to a specific job
teamcity run list --revision abc1234 --job MyProject_Build
# Auto-detect the current HEAD commit
teamcity run list --revision @head
時間ベースのフィルタリング
--since と --until を使用して時間でフィルタリングします。期間オフセット(24h、7d、2w、1mo、4w2d5h)または ISO 日付(2026-01-15、2026-01-15T12:00:00Z)を受け入れます。
# Builds from the last 24 hours
teamcity run list --since 24h
# Builds from the last week
teamcity run list --since 7d
# Builds from a specific date onward
teamcity run list --since 2026-01-15
# Builds in a time range
teamcity run list --since 2026-01-15 --until 2026-01-20
結果を制限する
teamcity run list --limit 20
出力オプション
# JSON output (see Scripting and automation for details)
teamcity run list --json
teamcity run list --json=id,status,webUrl
# Plain text for scripting
teamcity run list --plain
teamcity run list --plain --no-header
# Build a specific branch
teamcity run start MyProject_Build --branch feature/login
# Build the branch you are currently on
teamcity run start MyProject_Build --branch @this
# Pin to a specific Git commit
teamcity run start MyProject_Build --branch main --revision abc123def
# Pin to the current HEAD
teamcity run start MyProject_Build --branch @this --revision @head
# Clean all source files before building
teamcity run start MyProject_Build --clean
# Rebuild all dependencies
teamcity run start MyProject_Build --rebuild-deps
# Rebuild only failed dependencies
teamcity run start MyProject_Build --rebuild-failed-deps
# Reuse existing builds as snapshot dependencies (pin by build ID)
teamcity run start MyProject_Build --reuse-deps 6946,6917
# Add to the top of the queue
teamcity run start MyProject_Build --top
# Run on a specific agent
teamcity run start MyProject_Build --agent 5
teamcity run start MyProject_Build --branch main --watch
タイムアウトを設定したり、ポーリング間隔を調整したりすることもできます。
teamcity run start MyProject_Build --watch --timeout 30m
teamcity run start MyProject_Build --watch --interval 10
パーソナルビルド
コミットされていないローカルの変更を個人ビルドに含めます。
# Auto-detect changes from Git working directory
teamcity run start MyProject_Build --local-changes
# From a patch file
teamcity run start MyProject_Build --local-changes changes.patch
# From stdin
git diff | teamcity run start MyProject_Build --local-changes -
teamcity run cancel 12345
teamcity run cancel 12345 --comment "Canceling for hotfix"
確認プロンプトをスキップするには、--yes を使用します。
teamcity run cancel 12345 --yes
実行を再開する
同じ設定で実行を再開する:
teamcity run restart 12345
teamcity run restart 12345 --watch
teamcity run restart 12345 --timeout 30m
teamcity run restart 12345 --web
アーティファクト
遺物の一覧
ダウンロードせずに実行結果のアーティファクトを一覧表示する:
teamcity run artifacts 12345
teamcity run artifacts --job MyProject_Build
teamcity run artifacts 12345 --path html_reports/coverage
teamcity run artifacts 12345 --json
アーティファクトのダウンロード
完了した実行結果からアーティファクトをダウンロードする:
teamcity run download 12345
teamcity run download 12345 --path build/assets
teamcity run download 12345 -o ./artifacts
teamcity run download 12345 --artifact "*.jar"
teamcity run download 12345 --path build/assets -a "*.js"
teamcity run download 12345 --timeout 30m