Add migrate lab
This commit is contained in:
+54
-1
@@ -1 +1,54 @@
|
||||
# Perform a production migration of a Bitbucket pipeline
|
||||
# Perform a production migration of a Bitbucket pipeline
|
||||
|
||||
In this lab, you will use the `migrate` command to convert a Bitbucket pipeline and open a pull request with the equivalent Actions workflow.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
1. Followed the steps [here](./readme.md#configure-your-codespace) to set up your GitHub Codespaces environment.
|
||||
2. Completed the [configure lab](./1-configure.md#configuring-credentials).
|
||||
3. Completed the [dry-run lab](./4-dry-run.md).
|
||||
|
||||
## Performing a migration
|
||||
|
||||
Answer the following questions before running a `migrate` command:
|
||||
|
||||
1. What repository do you want to migrate?
|
||||
- __basic-pipeline__
|
||||
2. What is the workspace for that repository?
|
||||
- __actions-importer__
|
||||
3. Where do you want to store the logs?
|
||||
- __tmp/migrate__
|
||||
4. 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.
|
||||
|
||||
### Steps
|
||||
|
||||
1. Run the following `migrate` command in the codespace terminal:
|
||||
|
||||
```bash
|
||||
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: We are utilizing `--source-file-path` specifically for this lab, and it may not be necessary for regular use.
|
||||
2. The command will write the URL to the pull request that was created when the command succeeds.
|
||||
|
||||
```console
|
||||
$ 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'
|
||||
```
|
||||
|
||||
3. Open the generated pull request in a new browser tab.
|
||||
|
||||
### Inspect the pull request
|
||||
|
||||
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!
|
||||
|
||||
### Next Lab
|
||||
|
||||
This concludes all labs for migrating Bitbucket pipelines to Actions with GitHub Actions Importer!
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
image: atlassian/default-image:3
|
||||
|
||||
pipelines:
|
||||
default:
|
||||
- parallel:
|
||||
- step:
|
||||
name: 'Build and Test'
|
||||
script:
|
||||
- echo "Your build and test goes here..."
|
||||
- step:
|
||||
name: 'Lint'
|
||||
script:
|
||||
- echo "Your linting goes here..."
|
||||
- step:
|
||||
name: 'Security scan'
|
||||
script:
|
||||
- echo "Your security scan goes here..."
|
||||
- step:
|
||||
name: 'Deployment to Staging'
|
||||
script:
|
||||
- echo "Your deployment to staging script goes here..."
|
||||
- step:
|
||||
name: 'Deployment to Production'
|
||||
trigger: 'manual'
|
||||
script:
|
||||
- echo "Your deployment to production script goes here..."
|
||||
Reference in New Issue
Block a user