Files
importer-labs/azure_devops/valet-migrate-lab.md
T

60 lines
2.6 KiB
Markdown
Raw Normal View History

2022-05-10 14:32:07 -07:00
# Migrate an Azure DevOps pipeline to GitHub Actions
2022-05-25 10:57:51 -07:00
In this lab, you will use the Valet `migrate` command to migrate an Azure DevOps pipeline to GitHub Actions. The `migrate` subcommand can be used to convert a pipeline to its GitHub Actions equivalent and then create a pull request with the contents.
- [Prerequisites](#prerequisites)
- [Identify the Azure DevOps pipeline ID to use](#identify-the-azure-devops-pipeline-id-to-use)
- [Perform a migration](#perform-a-migration)
- [View the pull request](#view-the-pull-request)
- [Next Lab](#next-lab)
2022-05-10 14:32:07 -07:00
## Prerequisites
1. Follow all steps [here](../azure_devops#readme) to set up your environment
2022-05-10 14:32:07 -07:00
2. Create or start a codespace in this repository (if not started)
3. Completed the [Valet audit lab](valet-audit-lab.md).
## Identify the Azure DevOps pipeline ID to use
You will need a pipeline ID to perform the migration
2022-05-25 10:57:51 -07:00
1. Go to the `valet/ValetBootstrap/pipelines` folder
2. Open the `valet/ValetBootstrap/pipelines/valet-pipeline1.config.json` file
2022-05-10 14:32:07 -07:00
3. Look for the `web - href` link
4. At the end of the link is the pipeline ID. Copy or note the ID.
### Example
![Screen Shot 2022-05-10 at 8 50 06 AM](https://user-images.githubusercontent.com/26442605/167670536-b46aa383-74bd-4e22-a782-0de5d0ce64a5.png)
## Perform a migration
You will use the codespace preconfigured in this repository to perform the migration.
1. Navigate to the codespace Visual Studio Code terminal
2022-05-25 10:57:51 -07:00
2. Verify you are in the valet directory
2022-05-10 14:32:07 -07:00
3. Copy the following command and replace:
- `GITHUB-ORG` with the name of your organization.
- `GITHUB-REPO` with the name of your repository.
- `PIPELINE-ID` with your pipeline ID.
2022-06-30 12:37:28 -07:00
4. Run `gh valet migrate` from the `valet` directory to migrate the pipeline to GitHub Actions..
2022-05-10 14:32:07 -07:00
```
2022-06-10 20:31:36 +00:00
gh valet migrate azure-devops pipeline --target-url https://github.com/GITHUB-ORG/GITHUB-REPO --pipeline-id PIPELINE-ID --output-dir migrate
2022-05-10 14:32:07 -07:00
```
### Example
2022-05-25 10:57:51 -07:00
![valet-migrate-1](https://user-images.githubusercontent.com/26442605/169617557-289cee54-0116-4d13-8e6f-a9d0508259e1.png)
2022-05-10 14:32:07 -07:00
5. Valet will create a pull request directly to your GitHub repository.
6. Click the green pull request link in the output of the migrate command. See below.
### Example
2022-05-25 10:57:51 -07:00
![valet-migrate-5](https://user-images.githubusercontent.com/26442605/169617699-ce0c0720-8830-46ed-811d-c2fe1ccf06ea.png)
2022-05-10 14:32:07 -07:00
## View the pull request
The migrate output will show you the pull request on GitHub.
### Example
![migrate-pr](https://user-images.githubusercontent.com/26442605/161110724-f39d9cb9-1992-44c5-bea5-da2fcebb074c.png)
### Next Lab
[Migrate an Azure DevOps pipeline to GitHub Actions with a custom transformer](valet-migrate-custom-lab.md)