Update valet-migrate-lab.md

This commit is contained in:
j-dunham
2022-08-17 10:04:36 -04:00
committed by GitHub
parent d95798b8ea
commit a725818f1f
+5 -4
View File
@@ -1,7 +1,7 @@
# Migrate an GitLab Project to GitHub Actions
In this lab, we will use the Valet `migrate` command to migrate a GitLab pipeline to GitHub Actions.
All of the previous commands we have been using in the labs, such as `audit` and `dry-run` have been preparing us to run a migration.
The `migrate` command will generate the GitHub Actions workflow files, like the `dry-run` did, and also create a pull request with the files.
The `migrate` command will generate the GitHub Actions workflow files, like the `dry-run` did, and additionally create a pull request with the files.
The pull request will also contain a checklist of `Manual Tasks` if required. These tasks are changes that Valet could not do on our behalf, like creating a runner or adding a secret to a repository.
- [Prerequisites](#prerequisites)
@@ -19,7 +19,7 @@ Before running the command we need to collect some information:
1. What is the project we want to migrate? __rails-example__
2. What is the namespace for that project? __Valet. In this case the namespace is the same as the group the project is in__
3. Where do we want to store the logs? __./tmp/migrate__.
4. What is the URL for GitHub repository we want to add the workflow too? __this repo!__. *When constructing the value for the migrate command it should match this url https://github.com/GITHUB-ORG-USERNAME-HERE/GITHUB-REPO-NAME-HERE with `GITHUB-ORG-USERNAME` and `GITHUB-REPO-NAME` substitued with your values*
4. What is the URL for the GitHub repository we want to add the workflow too? __this repo!__. *When constructing the value for the migrate command it should match this url https://github.com/GITHUB-ORG-USERNAME-HERE/GITHUB-REPO-NAME-HERE with `GITHUB-ORG-USERNAME` and `GITHUB-REPO-NAME` substitued with your values*
## Performing a migration
1. Run `migrate` command using the information collected above, make sure to update the `--target-url` value with the information from step 4.
@@ -31,12 +31,13 @@ gh valet migrate gitlab --target-url https://github.com/GITHUB-ORG-USERNAME-HERE
![pr-screen-shot](https://user-images.githubusercontent.com/18723510/184953133-9bafd9a1-c3f0-40b3-8414-f23cea698c8e.png)
## Reviewing the pull request
- Lets first look at the `Conversation` tab of the PR. It tells us we have a manual task to perform before the GitHub Actions workflow is functional. We need to a secret. We can use the GitHub [documentation](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) for secrets and add a `actions` secret for `PASSWORD` with any value.
- Lets first look at the `Conversation` tab of the PR. It tells us we have a manual task to perform before the GitHub Actions workflow is functional. We need to add a secret. We can use the GitHub [documentation](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) for secrets and add a `actions` secret for `PASSWORD` with any value.
- Next, lets review the workflow we are adding by clicking on `Files changed` tab. This is where you would double check everything looks good.
- Next, lets 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.
- Now our review is completed we want to go back to the `Conversation` tab and click `Merge pull request`
- Once the PR is merged the new workflow should start and we can view it by clicking `Actions` in the top navigation
<img width="1119" alt="actions-screen-shot" src="https://user-images.githubusercontent.com/18723510/184960870-590b1a28-422f-4350-9ec0-0423bf7ad445.png">
- The migration is complete and we have success transformed a pipeline in GitLab, transformed into a GitHub Actions workflow, added to a GitHub Repository, and run in Actions
### Next Lab
[Forecast GitLab Usage](../gitlab/valet-forecast-lab.md)