О Actions Importer
Вы можете использовать Actions Importer для планирования и автоматической миграции поддерживаемых конвейеров CI/CD в Actions.
Actions Importer распространяется в виде контейнера Docker и использует расширение CLI CLI для взаимодействия с контейнером.
Любой рабочий процесс, преобразованный Actions Importer, следует проверить правильность перед использованием его в качестве рабочей рабочей нагрузки. Цель состоит в том, чтобы достичь скорости преобразования 80 % для каждого рабочего процесса, однако фактический коэффициент преобразования будет зависеть от состава каждого преобразованного конвейера.
Поддерживаемые платформы CI
Для миграции с следующих платформ можно использовать Actions Importer:
- Azure DevOps
- Bamboo
- Конвейеры Bitbucket
- CircleCI
- GitLab (как облачное, так и локальное)
- Jenkins
- Travis CI
Необходимые компоненты
Actions Importer имеет следующие требования:
Установка расширения CLI Actions Importer
Установите расширение CLI Actions Importer :
Bash gh extension install /gh-actions-importer
gh extension install /gh-actions-importer
Убедитесь, что расширение установлено:
$ gh actions-importer -h Options: -?, -h, --help Show help and usage information Commands: update Update to the latest version of Actions Importer. version Display the version of 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 Actions usage from historical pipeline utilization. dry-run Convert a pipeline to a Actions workflow and output its yaml file. migrate Convert a pipeline to a Actions workflow and open a pull request with the changes.
Обновление интерфейса командной строки Actions Importer
Чтобы убедиться, что вы используете последнюю версию Actions Importer, следует регулярно выполнять update
команду:
gh actions-importer update
Проверка подлинности в командной строке
Необходимо настроить учетные данные, позволяющие Actions Importer взаимодействовать с и текущим сервером CI. Эти учетные данные можно настроить с помощью переменных среды или .env.local
файла. Переменные среды можно настроить в интерактивной строке, выполнив следующую команду:
gh actions-importer configure
Использование интерфейса командной строки командной строки Actions Importer
Используйте вложенные команды gh actions-importer
для начала миграции на Actions, включая audit
, и forecast``dry-run
.migrate
Аудит существующих конвейеров CI
audit
Подкоманда может использоваться для планирования миграции CI/CD путем анализа текущего следа CI/CD. Этот анализ можно использовать для планирования временной шкалы миграции на 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.
Прогнозирование использования
Подкоманда forecast
проверяет использование исторического конвейера для создания прогноза использования Actions .
Чтобы выполнить прогноз, используйте следующую команду, чтобы определить доступные параметры:
$ gh actions-importer forecast -h
Description:
Forecasts Actions usage from historical pipeline utilization.
[...]
Commands:
azure-devops Forecasts Actions usage from historical Azure DevOps pipeline utilization.
bamboo Forecasts Actions usage from historical Bamboo pipeline utilization.
jenkins Forecasts Actions usage from historical Jenkins pipeline utilization.
gitlab Forecasts Actions usage from historical GitLab pipeline utilization.
circle-ci Forecasts Actions usage from historical CircleCI pipeline utilization.
travis-ci Forecasts Actions usage from historical Travis CI pipeline utilization.
Forecasts Actions usage from historical pipeline utilization.
Тестирование процесса миграции
dry-run
Подкоманда может использоваться для преобразования конвейера в его эквивалент Actions, а затем записать рабочий процесс в локальную файловую систему.
Чтобы выполнить сухой запуск, используйте следующую команду, чтобы определить доступные варианты:
$ gh actions-importer dry-run -h
Description:
Convert a pipeline to a Actions workflow and output its yaml file.
[...]
Commands:
azure-devops Convert an Azure DevOps pipeline to a Actions workflow and output its yaml file.
bamboo Convert a Bamboo pipeline to Actions workflows and output its yaml file.
circle-ci Convert a CircleCI pipeline to Actions workflows and output the yaml file(s).
gitlab Convert a GitLab pipeline to a Actions workflow and output the yaml file.
jenkins Convert a Jenkins job to a Actions workflow and output its yaml file.
travis-ci Convert a Travis CI pipeline to a Actions workflow and output its yaml file.
Перенос конвейера в Actions
migrate
Подкоманда может использоваться для преобразования конвейера в эквивалент Actions, а затем создать запрос на вытягивание с содержимым.
Чтобы выполнить миграцию, используйте следующую команду, чтобы определить доступные параметры:
$ gh actions-importer migrate -h
Description:
Convert a pipeline to a Actions workflow and open a pull request with the changes.
[...]
Commands:
azure-devops Convert an Azure DevOps pipeline to a Actions workflow and open a pull request with the changes.
bamboo Convert a Bamboo pipeline to Actions workflows and open a pull request with the changes.
circle-ci Convert a CircleCI pipeline to Actions workflows and open a pull request with the changes.
gitlab Convert a GitLab pipeline to a Actions workflow and open a pull request with the changes.
jenkins Convert a Jenkins job to a Actions workflow and open a pull request with the changes.
travis-ci Convert a Travis CI pipeline to a Actions workflow and open a pull request with the changes.
Выполнение самостоятельной миграции с помощью IssueOps
Можно использовать Actions и Issues для выполнения команд CLI для Actions Importer. Это позволяет перенести рабочие процессы CI/CD без установки программного обеспечения на локальном компьютере. Этот подход особенно полезен для организаций, которые хотят включить самостоятельные миграции на Actions. После настройки IssueOps пользователи могут открыть проблему с соответствующим шаблоном для переноса конвейеров в Actions.
Дополнительные сведения о настройке самостоятельной миграции с помощью IssueOps см. в репозитории actions/importer-issue-ops
шаблонов.
Использование репозитория лабораторий Actions Importer
Репозиторий лабораторий Actions Importer содержит путь обучения для конкретной платформы, который учит вас использовать Actions Importer и способы перехода на Actions. Этот репозиторий позволяет узнать, как использовать Actions Importer для планирования, прогнозирования и автоматизации миграции на Actions.
Дополнительные сведения см. в репозитории лабораторий Actions Importer.
Юридическая информация
Части были адаптированы в соответствии с https://.com//gh-actions-importer/ лицензией MIT:
MIT License
Copyright (c) 2022
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.