Bitbucket で新しいランナーを追加する

新しいリポジトリ ランナーを追加する

ランナーをリポジトリに追加することで、ワークスペースにある特定のリポジトリを対象として独自のインフラストラクチャで Pipelines によるビルドを実行できます。リポジトリあたり最大 100 件のランナーを登録できます。

  1. 新しいランナーを登録するには、ランナーを作成するリポジトリに移動します。

  2. 左側のナビゲーション サイドバーから [リポジトリ設定] を選択します。

  3. 左側のサイドバーの [Pipelines] 見出しの下で、[ランナー] を選択します。

  4. [Add runner (ランナーを追加)] を選択して、新しいランナーを追加します。このリポジトリにすでにランナーを登録している場合は、これまでに登録されているすべてのランナーのリストが表示されます。

ランナーが空の状態のユーザー インターフェイスを追加する

5. Select Linux, Windows, or MacOS from the System and architecture dropdown menu, depending on whether you are creating the self-hosted runner in a Linux or Windows environment.

6. [Runner installation (ランナー インストール)] ダイアログで、ランナー名を追加します。

ランナー インストール ダイアログ

7. [ランナー ラベル] フィールドにラベルを追加することで、ラベルをランナーに割り当てます。
a. ラベルに使用できる文字は、小文字の英数字とドットのみです。
b. ランナーごとに最大 10 件のカスタム ラベルを作成できますが、
ステップのスケジュール時にランナーを区別する必要がない場合は追加不要です。
c. 既定では、self.hosted ラベルと適切な linuxlinux.arm64windowsmacoslinux.shell ラベルが [ランナー ラベル] に追加されます。

ラベルを使用すると、特定の要件を満たすランナーのステップをスケジュールできます。たとえば、Linux Alpine ホストで実行するビルド ステップのランナーを対象とする場合はランナーに「os.linux.alpine」というラベルを付け、特別な構成を持つランナーには「env.prod」というラベルを付け、実稼働環境に展開できるようにします。

8. [次へ] を選択します。

9. For Linux (Docker): Copy/paste and run the pre-configured Docker command on your runner host machine. This command automatically downloads and starts the necessary software to run build steps on your host. The token in the provided command will automatically authenticate the host with Bitbucket.
For Windows, macOS, and Linux Shell: A list of pre-configured PowerShell or Bash commands that you will need to run on the host machine where you’re installing your runners is provided. It will download, unzip, and start the software necessary to run build steps on your host. The token in the command will automatically authenticate the host with Bitbucket. Note: Make sure you securely save the commands, as the commands only displays once and you will not be able to access it again after the setup is complete.

セットアップ後の再アクセスに必要になるため、提供されたコマンドをどこかに書き留めておいてください。

10. [次へ] を選択します。

11. [終了] を選択して、セットアップを完了します。これで、新しいランナーがリポジトリで利用可能なランナーとしてリストされます。ランナーを起動するコマンドを実行するまでは、未登録の状態になります。

Pipelines でランナーを使用する前に、コマンドを実行してランナーの状態が「オンライン」に変わっていることをご確認ください。

新しいワークスペース ランナーを追加する

ワークスペース内でランナーを使用することで、ワークスペースにある任意リポジトリを対象として独自のインフラストラクチャで Pipelines によるビルドを実行できます。ワークスペースあたり最大 100 件のランナーを登録できます。

  1. 新しいランナーを登録するには、ランナーを作成するワークスペースに移動します。ワークスペースを選択するには、プロファイル アバターを選択して、[最近のワークスペース] リストからワークスペースを選択するか、[すべてのワークスペース] を選択して、自分がメンバーになっているすべてのワークスペースをリストしたページを開きます。

  2. 上部のナビゲーション バーにある [設定] (歯車アイコン ) を選択します。

  3. [設定] ドロップダウン メニューから [ワークスペース設定] を選択します。

  4. [Pipelines] セクションで [Workspace runners (ワークスペース ランナー)] を選択します。

  5. このワークスペースに属するすべてのランナーのリストが表示されます。最初のランナーを登録している場合、これは空になります。新しいランナーを追加するには [Add runner (ランナーを追加)] を選択します。

  6. Select either Linux, Windows, or MacOS from the System and architecture dropdown menu, depending on whether you are creating the self-hosted runner in a Linux or Windows environment.

  7. [Runner installation (ランナー インストール)] ダイアログで、ランナー名を追加します。

  8. [ランナー ラベル] フィールドにラベルを追加して割り当てます。
    a. ラベルに使用できる文字は、小文字の英数字とドットのみです。
    b. ランナーごとに最大 10 件のカスタム ラベルを作成できますが、ステップのスケジュール時にランナーを区別する必要がない場合は追加不要です。c. 初期設定では、self.hostedLinux または Windows の各ラベルがランナー ラベルに追加されます。

ラベルを使用すると、特定の要件を満たすランナーのステップをスケジュールできます。たとえば、Linux Alpine ホストで実行するビルド ステップのランナーを対象とする場合はランナーに「os.linux.alpine」というラベルを付け、特別な構成を持つランナーには「env.prod」というラベルを付け、実稼働環境に展開できるようにします。

8. [次へ] を選択します。

9. For Linux: Copy/paste and run the pre-configured Docker command on your runner host machine. This command automatically downloads and starts the necessary software to run build steps on your host. The token in the provided command will automatically authenticate the host with Bitbucket.
For Windows: A list of pre-configured PowerShell commands that you will need to run on the host machine where you’re installing your runners is provided. It will download, unzip, and start the software necessary to run build steps on your host. The token in the command will automatically authenticate the host with Bitbucket. Note: Make sure you securely save the commands, as the commands only displays once and you will not be able to access it again after the setup is complete.

セットアップ後の再アクセスに必要になるため、提供されたコマンドをどこかに書き留めておいてください。

10. [次へ] を選択します。

11. [終了] を選択して、セットアップを完了します。これで、新しいランナーがリポジトリで利用可能なランナーとしてリストされます。これは、ステップ 6 で保存したコマンドをホスト マシンで実行するまで、未登録の状態のままになります。

Pipelines でランナーを使用する前に、コマンドを実行して、ランナーの状態が「オンライン」に変わっていることを確認してください。

 

さらにヘルプが必要ですか?

アトラシアン コミュニティをご利用ください。