GitHub Actions Importer로 마이그레이션 자동화하기

GitHub Actions Importer로 마이그레이션 자동화하기

GitHub Actions Importer를 사용해서 GitHub Actions로의 마이그레이션을 계획하고 자동화하는 방법을 알려드릴게요. CI/CD 파이프라인을 GitHub Actions로 마이그레이션할 수 있게 계획하고 자동 변환하는 방법을 배울 수 있어요.

출처: 문서

본문

About GitHub Actions Importer

GitHub Actions Importer를 사용해서 지원되는 CI/CD 파이프라인을 GitHub Actions로 계획하고 자동으로 마이그레이션할 수 있어요.

GitHub Actions Importer는 Docker 컨테이너로 배포되며, GitHub CLI 확장 프로그램을 사용해서 컨테이너와 상호작용해요.

GitHub Actions Importer가 변환한 모든 워크플로우는 프로덕션 워크로드로 사용하기 전에 정확성을 검사해야 해요. 목표는 모든 워크플로우에 대해 80% 변환율을 달성하는 것이지만, 실제 변환율은 변환되는 각 파이프라인의 구성에 따라 달라져요.

Supported CI platforms

GitHub Actions Importer를 사용해서 다음 플랫폼에서 마이그레이션할 수 있어요.

  • Azure DevOps
  • Bamboo
  • Bitbucket Pipelines
  • CircleCI
  • GitLab (both cloud and self-hosted)
  • Jenkins
  • Travis CI

Prerequisites

GitHub Actions Importer의 요구사항은 다음과 같아요.

  • Linux 기반 컨테이너를 실행하고 필요한 도구를 설치할 수 있는 환경.

    [!NOTE] GitHub Actions Importer 컨테이너와 CLI는 CI 플랫폼과 같은 서버에 설치할 필요가 없어요.

Installing the GitHub Actions Importer CLI extension

  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 GitHub Actions Importer.
      version    Display the version of 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.
    

Updating the GitHub Actions Importer CLI

최신 버전의 GitHub Actions Importer를 실행하고 있는지 확인하려면 update 명령을 정기적으로 실행해야 해요.

gh actions-importer update

Authenticating at the command line

GitHub Actions Importer가 GitHub와 현재 CI 서버와 통신할 수 있게 하는 자격 증명을 구성해야 해요. 환경 변수나 .env.local 파일을 사용해서 이 자격 증명을 구성할 수 있어요. 다음 명령을 실행해서 대화형 프롬프트에서 환경 변수를 구성할 수 있어요.

gh actions-importer configure

Using the GitHub Actions Importer CLI

gh actions-importer의 하위 명령을 사용해서 audit, forecast, dry-run, migrate를 포함한 GitHub Actions 마이그레이션을 시작하세요.

Auditing your existing CI pipelines

audit 하위 명령은 현재 CI/CD 사용자 환경(footprint)을 분석해서 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.
  bamboo        An audit will output a list of data used in a Bamboo 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.

Forecasting usage

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.
  bamboo        Forecasts GitHub Actions usage from historical Bamboo 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.

Testing the migration process

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.
  bamboo        Convert a Bamboo pipeline to GitHub Actions workflows 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.

Migrating a pipeline to GitHub Actions

migrate 하위 명령은 파이프라인을 GitHub Actions 등가물로 변환한 다음 내용으로 풀 리퀘스트를 만들 수 있어요.

마이그레이션을 실행하려면 다음 명령을 사용해서 사용 가능한 옵션을 확인하세요.

$ 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.
  bamboo        Convert a Bamboo pipeline to GitHub Actions workflows 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 open a pull request with the changes.

Performing self-serve migrations using IssueOps

GitHub Actions와 GitHub Issues를 사용해서 GitHub Actions Importer용 CLI 명령을 실행할 수 있어요. 이렇게 하면 로컬 머신에 소프트웨어를 설치하지 않고도 CI/CD 워크플로우를 마이그레이션할 수 있어요. 이 방식은 GitHub Actions로 셀프 서비스 마이그레이션을 활성화하려는 조직에 특히 유용해요. IssueOps가 구성되면 사용자는 관련 템플릿으로 이슈를 열어 파이프라인을 GitHub Actions로 마이그레이션할 수 있어요.

IssueOps로 셀프 서비스 마이그레이션을 설정하는 방법에 대한 자세한 내용은 actions/importer-issue-ops 템플릿 저장소를 참고하세요.

Using the GitHub Actions Importer labs repository

GitHub Actions Importer labs 저장소에는 GitHub Actions Importer 사용법과 GitHub Actions로의 마이그레이션 접근 방식을 가르치는 플랫폼별 학습 경로가 포함되어 있어요. 이 저장소를 사용해서 GitHub Actions Importer를 사용해 GitHub Actions로의 마이그레이션을 계획, 예측, 자동화하는 방법을 배울 수 있어요.

자세한 내용은 GitHub Actions Importer labs repository를 참고하세요.

일부 내용은 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.

더 알아보기 (Learn more)