Skip to main content

このバージョンの GitHub Enterprise はこの日付をもって終了となりました: 2023-01-18. 重大なセキュリティの問題に対してであっても、パッチリリースは作成されません。 パフォーマンスの向上、セキュリティの向上、新機能の向上を図るために、最新バージョンの GitHub Enterprise にアップグレードします。 アップグレードに関するヘルプについては、GitHub Enterprise サポートにお問い合わせく� さい

GitHub Actions Importer を使用した移行の自動化

GitHub Actions Importer を使って、GitHub Actions への移行を計画し自動化します。

注: GitHub ホステッド ランナーは、現在 GitHub Enterprise Server でサポートされていません。 GitHub public roadmap で、今後の計画的なサポートの詳細を確認できます。

法的通知

: GitHub Actions Importer は現在、パブリック プレビューとしてお使いいた� けます。 プレビューへのアクセスをリクエストする� �合は、サインアップ ページにアクセスしてく� さい。 アクセス権が付与されると、gh-actions-importer CLI 拡張機能をお使いいた� けるようになります。

GitHub Actions Importer について

GitHub Actions Importer を使用して、Azure DevOps、CircleCI、GitLab、Jenkins、Travis CI から CI/CD パイプラインを計画して GitHub Actions に自動的に移行することができます。

GitHub Actions Importer は Docker コンテナーとして配布され、GitHub CLI 拡張機能を使用してコンテナーとやりとりします。

GitHub Actions Importer によって変換されたワークフローは、運用ワークロードとして使用する前に、正確性を検査する必要があります。 目標は、すべてのワークフローで 80% の変換率を達成することですが、実際の変換率は、変換される各パイプラインの構成によって異なります。

サポートされている CI プラットフォー� 

GitHub Actions Importer を使用すると、次のプラットフォー� から移行することができます。

  • Azure DevOps
  • CircleCI
  • GitLab
  • Jenkins
  • Travis CI

プレビューへのアクセス権が付与されると、サポートされている各プラットフォー� の参照ドキュメントにアクセスできるようになります。

前提条件

GitHub Actions Importer には、次の要件があります。

  • GitHub Actions Importer のパブリック プレビューへのアクセス権が付与されている必要があります。

  • read:packages スコープが有効になっている personal access token を使用します。

  • Linux ベースのコンテナーを実行し、必要なツールをインストールできる環境。

    : GitHub Actions Importer コンテナーと CLI は、CI プラットフォー� と同じサーバーにインストールする必要はありません。

GitHub Actions Importer CLI 拡張機能のインストール

  1. GitHub Actions Importer CLI 拡張機能のインストール

    $ gh extension install github/gh-actions-importer
    
  2. 拡張機能がインストールされていることを確認します。

    $ gh actions-importer -h
    Options:
      -?, -h, --help  Show help and usage information
    
    Commands:
      update     Update to the latest version of the GitHub Actions Importer.
      version    Display the version of the GitHub Actions Importer.
      configure  Start an interactive prompt to configure credentials used to authenticate with your CI server(s).
      audit      Plan your CI/CD migration by analyzing your current CI/CD footprint.
      forecast   Forecast GitHub Actions usage from historical pipeline utilization.
      dry-run    Convert a pipeline to a GitHub Actions workflow and output its yaml file.
      migrate    Convert a pipeline to a GitHub Actions workflow and open a pull request with the changes.
    

GitHub Actions Importer CLI の更新

最新バージョンの GitHub Actions Importer を実行していることを確認するには、update コマンドを定期的に実行する必要があります。

$ gh actions-importer update

このコマンドを正常に実行するには、Container registry で認証する必要があります。 または、--username および --password-stdin パラメーターを使用して資� �情� �を指定することもできます。

$ echo $GITHUB_TOKEN | gh actions-importer update --username $GITHUB_HANDLE --password-stdin

コマンドラインで認証する

GitHub Actions Importer が GitHub および現在の CI サーバーと通信できるようにする資� �情� �を構成する必要があります。 これらの資� �情� �は、環境変数または .env.local ファイルを使用して構成できます。 環境変数は、次のコマンドを実行して、対話型プロンプトで構成できます。

$ gh actions-importer configure

プレビューへのアクセス権が付与されると、環境変数の使用に関する参照ドキュメントにアクセスできるようになります。

GitHub Actions Importer CLI の使用

gh actions-importer のサブコマンドを使って、GitHub Actions への移行を始めます。auditforecastdry-runmigrate が含まれます。

既存の CI パイプラインの監査

audit サブコマンドは、現在の CI/CD � 有� �域を分析して、CI/CD の移行の計画に使用できます。 この解析を使用して、GitHub Actions への移行のタイ� ラインを計画できます。

監査を実行するには、次のコマンドを使用して、使用可能なオプションを決定します。

$ gh actions-importer audit -h
Description:
  Plan your CI/CD migration by analyzing your current CI/CD footprint.

[...]

Commands:
  azure-devops  An audit will output a list of data used in an Azure DevOps instance.
  circle-ci     An audit will output a list of data used in a CircleCI instance.
  gitlab        An audit will output a list of data used in a GitLab instance.
  jenkins       An audit will output a list of data used in a Jenkins instance.
  travis-ci     An audit will output a list of data used in a Travis CI instance.

プレビューへのアクセス権が付与されると、監査の実行に関する参照ドキュメントにアクセスできるようになります。

使用状況の予測

forecast サブコマンドは、パイプラインの使用状況の履歴を確認して、GitHub Actions 使用量の予測を作成します。

予測を実行するには、次のコマンドを使用して、使用可能なオプションを決定します。

$ gh actions-importer forecast -h
Description:
  Forecasts GitHub Actions usage from historical pipeline utilization.

[...]

Commands:
  azure-devops  Forecasts GitHub Actions usage from historical Azure DevOps pipeline utilization.
  jenkins       Forecasts GitHub Actions usage from historical Jenkins pipeline utilization.
  gitlab        Forecasts GitHub Actions usage from historical GitLab pipeline utilization.
  circle-ci     Forecasts GitHub Actions usage from historical CircleCI pipeline utilization.
  travis-ci     Forecasts GitHub Actions usage from historical Travis CI pipeline utilization.
  github        Forecasts GitHub Actions usage from historical GitHub pipeline utilization.

プレビューへのアクセス権が付与されると、予測の実行に関する参照ドキュメントにアクセスできるようになります。

移行プロセスのテスト

dry-run サブコマンドを使用して、パイプラインを同等の GitHub Actions に変換し、ワークフローをローカル ファイルシステ� に書き込むことができます。

ドライ ランを実行するには、次のコマンドを使用して、使用可能なオプションを決定します。

$ gh actions-importer dry-run -h
Description:
  Convert a pipeline to a GitHub Actions workflow and output its yaml file.

[...]

Commands:
  azure-devops  Convert an Azure DevOps pipeline to a GitHub Actions workflow and output its yaml file.
  circle-ci     Convert a CircleCI pipeline to GitHub Actions workflows and output the yaml file(s).
  gitlab        Convert a GitLab pipeline to a GitHub Actions workflow and output the yaml file.
  jenkins       Convert a Jenkins job to a GitHub Actions workflow and output its yaml file.
  travis-ci     Convert a Travis CI pipeline to a GitHub Actions workflow and output its yaml file.

プレビューへのアクセス権が付与されると、ドライ ランの実行に関する参照ドキュメントにアクセスできるようになります。

GitHub Actions へのパイプラインの移行

migrate サブコマンドを使用して、パイプラインを同等の GitHub Actions に変換し、その内容を含む pull request を作成できます。

移行を実行するには、次のコマンドを使用して、使用可能なオプションを決定します。

$ gh actions-importer migrate -h
Description:
  Convert a pipeline to a GitHub Actions workflow and open a pull request with the changes.

[...]

Commands:
  azure-devops  Convert an Azure DevOps pipeline to a GitHub Actions workflow and open a pull request with the changes.
  circle-ci     Convert a CircleCI pipeline to GitHub Actions workflows and open a pull request with the changes.
  gitlab        Convert a GitLab pipeline to a GitHub Actions workflow and open a pull request with the changes.
  jenkins       Convert a Jenkins job to a GitHub Actions workflow and open a pull request with the changes.
  travis-ci     Convert a Travis CI pipeline to a GitHub Actions workflow and and open a pull request with the changes.

プレビューへのアクセス権が付与されると、移行の実行に関する参照ドキュメントにアクセスできるようになります。

MIT ライセンスのもとで https://github.com/github/gh-actions-importer/ から一部を引用しています。

MIT License

Copyright (c) 2022 GitHub

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.