In this lab, you will use the migrate
command to convert a Bitbucket pipeline and open a pull request with the equivalent Actions workflow.
- Followed the steps here to set up your GitHub Codespaces environment.
- Completed the configure lab.
- Completed the dry-run lab.
Answer the following questions before running a migrate
command:
- What repository do you want to migrate?
- basic-pipeline
- What is the workspace for that repository?
- actions-importer
- Where do you want to store the logs?
- tmp/migrate
- What is the URL for the GitHub repository to add the workflow to?
- this repository. The URL should should follow the pattern https://github.com/:owner/:repo with
:owner
and:repo
replaced with your values.
- this repository. The URL should should follow the pattern https://github.com/:owner/:repo with
-
Run the below
migrate
command in the codespace terminal, remember to update the--target-url
before executing:gh actions-importer migrate bitbucket --target-url https://github.com/:owner/:repo --output-dir tmp/migrate --workspace actions-importer --repository basic-pipeline --source-file-path ./bitbucket/bootstrap/source_files/basic_pipeline.yml
Note: The
--source-file-path
option is not required and is used throughout this lab to convert files that are stored locally. This can be omitted and GitHub Actions Importer will programmatically fetch pipeline definitions using the Bitbucket REST APIs. -
The command will write the URL to the pull request that was created when the command succeeds.
$ gh actions-importer migrate bitbucket --target-url https://github.com/:owner/:repo --output-dir tmp/migrate --workspace actions-importer --repository basic-pipeline --source-file-path ./bitbucket/bootstrap/source_files/basic_pipeline.yml [2022-08-20 22:08:20] Logs: 'tmp/migrate/log/actions-importer-20220916-014033.log' [2022-08-20 22:08:20] Pull request: 'https://github.com/:owner/:repo/pull/1'
-
Open the generated pull request in a new browser tab.
The first thing to notice about the pull request is that there is a list of manual steps to complete.
Next, you can inspect the "Files changed" in this pull request and see the converted workflow that is being added. Any additional changes or code reviews that were needed should be done in this pull request.
Finally, you can merge the pull request once your review has completed. You can then view the workflow running by selecting the "Actions" menu in the top navigation bar in GitHub.
At this point, the migration has completed and you have successfully migrated a Bitbucket pipeline to Actions!
This concludes all labs for migrating Bitbucket pipelines to Actions with GitHub Actions Importer!