Files
importer-labs/gitlab/5-migrate.md
T
2022-09-06 17:05:54 -07:00

2.5 KiB

Perform a production migration of a GitLab pipeline

In this lab, you will use the migrate command to convert a GitLab pipeline and open a pull request with the equivalent Actions workflow.

Prerequisites

  1. Followed the steps here to set up your Codespace environment and start a GitLab server.
  2. Completed the configure lab.
  3. Completed the dry-run lab.
  4. Completed the custom transformers lab.

Performing a migration

We need to answer the following questions before running a migrate command:

  1. What is the project we want to migrate?
    • rails-example
  2. What is the namespace for that project?
    • Valet
  3. Where do we want to store the logs?
    • ./tmp/migrate
  4. What is the URL for the GitHub repository to add the workflow to?

Steps

  1. Run the following migrate command in the codespace terminal:

    gh valet migrate gitlab --target-url https://github.com/:owner/:repo --output-dir ./tmp/migrate --namespace valet --project rails-example
    
  2. The command will write the URL to the pull request that was created when the command succeeds.

    img

  3. Open the generated pull request in a new browser tab.

Inspect the pull request

The first thing we should notice about the PR is that there is a list of manual steps for us to complete.

Next, let's review the workflow we are adding by clicking on Files changed tab. This is where you would double check everything looks good. If it didn't you could push commits with the required changes, prior to merging.

Next, you can inspect the "Files changed" in this PR and see the converted workflow that is being added. Any additional changes or code reviews that were needed should be done in this PR.

Finally, you can merge the PR once your review has completed. We can then view the workflow running by selecting the "Actions" menu in the top navigation bar in GitHub.

img

At this point, the migration has completed and you have successfully migrated a GitLab pipeline to Actions!

Next Lab

Forecast potential build runner usage