TeamCity On-Premises 2026.2 Help

エージェントインストールの構成

ビルドエージェントは、 <TeamCity エージェントホーム>/conf/buildAgent.properties ファイルで調整することで構成できます。

一般的なエージェント構成

この Java プロパティ(英語)構成ファイルには、 エージェントプロパティとしてサーバーに公開され、 エージェント要件式に参加できるプロパティを保存できます。 ファイルで定義されているすべての システムプロパティと環境プロパティは、エージェントで実行されるすべてのビルドに渡されます。

構文リファレンス:

  • プロパティ_お名前=値<改行> 構文を使用します。

  • コメントには、行の最初の位置に # を使用します。

  • パス区切り文字として、 \ の代わりに / を使用します。 \ を含める必要がある場合は、別の \ でエスケープします。

  • 空白は他のシンボルと同じように処理されます。

エージェント構成ファイルの例:

## The address of the TeamCity server. The same as is used to open the TeamCity web interface in the browser. ## Must include the protocol specification (https:// is recommended). serverUrl=http://localhost:8111/ ## The unique name of the agent used to identify this agent on the TeamCity server ## Use blank name to let server generate it. ## By default, this name would be created from the build agent's host name name=Default agent ## Container directory to create default checkout directories for the build configurations. workDir=../work ## Container directory for the temporary directories. ## Please note that the directory may be cleaned between the builds. tempDir=../temp ## Container directory for agent state files and caches. ## TeamCity agent assumes ownership of the directory and can delete the content inside. systemDir=../system ###################################### # Optional Agent Properties # ###################################### ## A token which is used to identify this agent on the TeamCity server for agent authorization purposes. ## It is automatically generated and saved back on the first agent connection to the server. authorizationToken=1234567890abcdefghijklml

ファイルがビルドエージェントプロセス自体に対して書き込み可能であることを確認してください。 例: サーバー側で生成された認証トークンを保存するようにファイルが更新されること。

複数の TeamCity ノードを リバースプロキシの背後にインストールする場合は、 サーバー URL をプロキシ URL に設定する必要があります。

お名前 プロパティが指定されていないと、サーバーは自動的にビルドエージェント名を生成します。 デフォルトでは、この名前はビルドエージェントのホスト名から作成されます。

ファイルはエージェントの実行中にも編集できます。エージェントは変更を検出し、(実行中のビルドがある場合はその完了後に) 新しい設定を読み込んで自動的に再起動します。

オプションプロパティ

ビルドエージェントポート

TeamCity エージェントは単方向モードで動作します。サーバーへのすべての接続はエージェントから開始され、その逆ではありません。 接続後、エージェントはキューに入っているビルドの処理などの新しいコマンドがないか、定期的にサーバーをポーリングします。 サーバーからの受信接続は行われないため、エージェントマシンの設定で開放ポートを設定する必要はありません。

ごくまれに、エージェントが同じマシン上で実行されている他のビルド関連プロセスとデータを共有するプロセスを実行することがあります。 これは主に、古いビルドステップやプラグインの実行に当てはまります。 このような場合、エージェントはローカルホストのポート 9090 を使用してデータを共有します。 このポートは ビルドエージェント.プロパティ ファイルで再定義できます。

ownPort=9090

このポートはローカルホスト上でのみ開かれているため、外部からの受信接続には使用できません。

代替フェッチ URL

特定のエージェントに対して、元の Git リポジトリよりも大幅に近い自己更新 Git リポジトリプロキシがある場合は、これらのエージェントがこのミラーからソースをダウンロードできるようにすることができます。 これを行うには、エージェント構成ファイルに teamcity.git.fetchUrlMapping.<お名前>=<元の URL> => <プロキシ URL> 設定を追加します。 詳細については、このセクションを参照してください: Git VCS ルート | 一般設定

Configure コマンド

buildAgent.properties ファイルを設定するには、 構成する コマンドを使用して <エージェントフォルダー>/bin/agent.bat または <エージェントフォルダー>/bin/agent.sh スクリプトを実行します。 このコマンドを使用すると、コアエージェントのプロパティを設定し、それをターゲット構成ファイルに保存できます。 構成ファイルのパスが指定されていない場合、変更はデフォルトの <エージェントフォルダー>/conf/buildAgent.properties プロパティに保存されます。

使用可能なパラメーターのリストを表示するには、 --help フラグを指定してこのコマンドを実行します。

./agent.sh configure --help Java executable is found: '/Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home/bin/java' Configuring TeamCity build agent... TeamCity Agent configurator Usage: configure PROPERTIES_FILE configure -f PROPERTIES_FILE configure [PROPERTIES] configure --usage status status short Where PROPERTIES format is --key=value or --key value Supported properties: * --agent-config-file=PATH - path to build agent properties file (<Agent Root>/conf/buildAgent.properties by default) * All default properties that can be configured in buildAgent.properties file Also there are aliases for some of them: auth-token = authorizationToken logs-dir = logsDir name = name server-url = serverUrl system-dir = systemDir temp-dir = tempDir work-dir = workDir

サーバーの URL を書き込み、カスタムエージェント名を設定するサンプルコマンド:

./agent.sh configure --server-url http://localhost:8111/ --name AG2

プロキシ背後のエージェントをセットアップ

エージェントからサーバーへの接続用にフォワードプロキシサーバーを構成することができます。

TeamCity エージェント側で、 ビルドエージェント.プロパティ ファイルの次のプロパティを使用して、TeamCity サーバーに接続するためのプロキシを指定します:

## The domain name or the IP address of the proxy host and the port teamcity.http.proxyHost=123.45.678.9 teamcity.http.proxyPort=8080   ## If the proxy requires authentication, specify the login and password teamcity.http.proxyLogin=login teamcity.http.proxyPassword=password

HTTPS エンドポイント (GitHub でホストされるリポジトリなど) にアクセスするには、 teamcity.https.* プロパティも構成します。

2026 年 9 月 11 日