Consistency across labs

This commit is contained in:
Matisse Hack
2022-09-16 12:35:07 -07:00
parent 0208cd1b69
commit 0e2823c6e3
14 changed files with 112 additions and 103 deletions
+3 -2
View File
@@ -7,7 +7,7 @@ You will need to complete all of the setup instructions [here](./readme.md#confi
## Configuring credentials
1. Create an Azure DevOps personal access token (PAT).
__Note__: you can skip this step if you still have the PAT created during the setup steps [here](./readme.md#bootstrap-your-azure-devops-organization).
- Navigate to your existing organization (<https://dev.azure.com/:organization>) in your browser.
- In the top right corner of your screen, click `User settings`.
@@ -62,7 +62,8 @@ To verify our environment is configured correctly, run the `update` CLI command.
2. You should see a confirmation that you were logged into the GitHub Container Registry and Valet was updated to the latest version.
```bash
```console
$ gh valet update
Login Succeeded
latest: Pulling from valet-customers/valet-cli
Digest: sha256:a7d00dee8a37e25da59daeed44b1543f476b00fa2c41c47f48deeaf34a215bbb
+1 -1
View File
@@ -20,7 +20,7 @@ You will now perform an audit against the bootstrapped Azure DevOps project. Ans
- __:project__. This should be the same project name used in the setup steps [here](./readme.md#bootstrap-your-azure-devops-organization)
3. Where do you want to store the result?
- __./tmp/audit__. This can be any path within the working directory from which Valet commands are executed.
- __tmp/audit__. This can be any path within the working directory from which Valet commands are executed.
### Steps
+5 -5
View File
@@ -5,7 +5,7 @@ In this lab you will use the `forecast` command to forecast potential GitHub Act
## Prerequisites
1. Followed the steps [here](./readme.md#configure-your-codespace) to set up your GitHub Codespaces environment and bootstrap an Azure DevOps project.
2. Completed the [configure lab](./1-configure-lab.md#configuring-credentials).
2. Completed the [configure lab](./1-configure.md#configuring-credentials).
## Perform a forecast
@@ -18,7 +18,7 @@ Answer the following questions before running the `forecast` command:
- __:project__. This should be the same project name used in the setup steps [here](./readme.md#bootstrap-your-azure-devops-organization)
3. Where do you want to store the results?
- `./tmp/forecast_reports`
- `tmp/forecast`
### Steps
@@ -26,7 +26,7 @@ Answer the following questions before running the `forecast` command:
2. Run the following command from the root directory:
```bash
gh valet forecast azure-devops --output-dir ./tmp/forecast_reports
gh valet forecast azure-devops --output-dir tmp/forecast
```
__Note__: The Azure DevOps organization and project name can be omitted from the `forecast` command because they were persisted in the `.env.local` file in the [configure lab](./1-configure.md). You can optionally provide these arguments on the command line with the `--azure-devops-organization` and `--azure-devops-project` CLI options.
@@ -42,7 +42,7 @@ Answer the following questions before running the `forecast` command:
5. Run the following `forecast` command while specifying the path to the sample json files:
```bash
gh valet forecast azure-devops --output-dir ./tmp/forecast_reports --source-file-path azure_devops/bootstrap/jobs.json
gh valet forecast azure-devops --output-dir tmp/forecast --source-file-path azure_devops/bootstrap/jobs.json
```
6. The command will list all the files written to disk when the command succeeds.
@@ -51,7 +51,7 @@ Answer the following questions before running the `forecast` command:
## Review the forecast report
The forecast report, logs, and completed job data will be located within the `tmp/forecast_reports` folder.
The forecast report, logs, and completed job data will be located within the `tmp/forecast` folder.
1. Find the `forecast_report.md` file in the file explorer.
2. Right-click the `forecast_report.md` file and select `Open Preview`.
+6 -6
View File
@@ -5,7 +5,7 @@ In this lab you will use the `dry-run` command to convert an Azure DevOps pipeli
## Prerequisites
1. Followed the steps [here](./readme.md#configure-your-codespace) to set up your GitHub Codespaces environment and bootstrap an Azure DevOps project.
2. Completed the [configure lab](./1-configure-lab.md#configuring-credentials).
2. Completed the [configure lab](./1-configure.md#configuring-credentials).
3. Completed the [audit lab](./2-audit.md).
## Perform a dry run
@@ -19,7 +19,7 @@ You will perform a dry run for a pipeline in the bootstrapped Azure DevOps proje
- Inspecting the URL to locate the pipeline id <https://dev.azure.com/:organization/:project/_build?definitionId=:pipeline_id>
2. Where do you want to store the result?
- __./tmp/dry-run-lab__. This can be any path within the working directory from which Valet commands are executed.
- __tmp/dry-run__. This can be any path within the working directory from which Valet commands are executed.
### Steps
@@ -27,14 +27,14 @@ You will perform a dry run for a pipeline in the bootstrapped Azure DevOps proje
2. Run the following command from the root directory:
```bash
gh valet dry-run azure-devops pipeline --pipeline-id :pipeline_id --output-dir tmp/dry-run-lab
gh valet dry-run azure-devops pipeline --pipeline-id :pipeline_id --output-dir tmp/dry-run
```
3. The command will list all the files written to disk when the command succeeds.
4. View the converted workflow:
- Find `./tmp/dry-run-lab` in the file explorer pane in your codespace.
- Find `tmp/dry-run` in the file explorer pane in your codespace.
- Click `valet-pipeline1.yml` to open.
## Inspect the output files
The files generated from the `dry-run` command represent the equivalent Actions workflow for the given Azure DevOps pipeline. The Azure DevOps pipeline and converted workflow can be seen below:
@@ -63,7 +63,7 @@ steps:
<details>
<summary><em>Converted workflow 👇</em></summary>
```yaml
name: valet-bootstrap/pipelines/valet-pipeline1
on:
+7 -7
View File
@@ -10,9 +10,9 @@ In this lab we will build upon the `dry-run` command to override Valet's default
## Prerequisites
1. Followed the steps [here](./readme.md#configure-your-codespace) to set up your GitHub Codespaces environment and bootstrap an Azure DevOps project.
2. Completed the [configure lab](./1-configure-lab.md#configuring-credentials).
2. Completed the [configure lab](./1-configure.md#configuring-credentials).
3. Completed the [audit lab](./2-audit.md).
4. Completed the [dry-run lab](./3-dry-run.md).
4. Completed the [dry-run lab](./4-dry-run.md).
## Perform a dry run
@@ -25,7 +25,7 @@ You will perform a dry-run for a pipeline in the bootstrapped Azure DevOps proje
- Inspecting the URL to locate the pipeline id <https://dev.azure.com/:organization/:project/_build?definitionId=:pipeline_id>
2. Where do you want to store the result?
- __./tmp/dry-run-lab__. This can be any path within the working directory from which Valet commands are executed.
- __tmp/dry-run__. This can be any path within the working directory from which Valet commands are executed.
### Steps
@@ -33,12 +33,12 @@ You will perform a dry-run for a pipeline in the bootstrapped Azure DevOps proje
2. Run the following command from the root directory:
```bash
gh valet dry-run azure-devops pipeline --pipeline-id :pipeline_id --output-dir tmp/dry-run-lab
gh valet dry-run azure-devops pipeline --pipeline-id :pipeline_id --output-dir tmp/dry-run
```
3. The command will list all the files written to disk when the command succeeds.
4. View the converted workflow:
- Find `./tmp/dry-run-lab` in the file explorer pane in your codespace.
- Find `tmp/dry-run` in the file explorer pane in your codespace.
- Click `valet-custom-transformer-example.yml` to open.
The converted workflow that is generated can be seen below:
@@ -77,7 +77,7 @@ jobs:
</details>
_Note_: You can refer to the previous [lab](./3-dry-run.md) to learn about the fundamentals of the `dry-run` command.
_Note_: You can refer to the previous [lab](./4-dry-run.md) to learn about the fundamentals of the `dry-run` command.
## Custom transformers for build steps
@@ -127,7 +127,7 @@ This method can use any valid ruby syntax and should return a `Hash` that repres
Now you can perform another `dry-run` command and use the `--custom-transformers` CLI option to provide this custom transformer. Run the following command within your codespace terminal:
```bash
gh valet dry-run azure-devops pipeline --pipeline-id :pipeline_id --output-dir tmp/dry-run-lab --custom-transformers transformers.rb
gh valet dry-run azure-devops pipeline --pipeline-id :pipeline_id --output-dir tmp/dry-run --custom-transformers transformers.rb
```
Open the workflow that is generated and inspect the contents. Now the `DotnetCoreCLI@2` steps are converted using the customized behavior!
+8 -8
View File
@@ -5,9 +5,9 @@ In this lab, you will use the `migrate` command to convert an Azure DevOps pipel
## Prerequisites
1. Followed the steps [here](./readme.md#configure-your-codespace) to set up your GitHub Codespaces environment and bootstrap an Azure DevOps project.
2. Completed the [configure lab](./1-configure-lab.md#configuring-credentials).
3. Completed the [dry-run lab](./3-dry-run.md).
4. Completed the [custom transformers lab](./4-custom-transformers.md).
2. Completed the [configure lab](./1-configure.md#configuring-credentials).
3. Completed the [dry-run lab](./4-dry-run.md).
4. Completed the [custom transformers lab](./5-custom-transformers.md).
## Performing a migration
@@ -19,7 +19,7 @@ Answer the following questions before running a `migrate` command:
- Selecting the pipeline with the name "valet-pipeline2"
- Inspecting the URL to locate the pipeline id <https://dev.azure.com/:organization/:project/_build?definitionId=:pipeline_id>
2. Where do you want to store the logs?
- __./tmp/migrate__
- __tmp/migrate__
3. What is the URL for the GitHub repository to add the workflow to?
- __this repository__. The URL should follow the pattern <https://github.com/:owner/:repo> with `:owner` and `:repo` replaced with your values.
@@ -28,14 +28,14 @@ Answer the following questions before running a `migrate` command:
1. Run the following `migrate` command in the codespace terminal:
```bash
gh valet migrate azure-devops pipeline --pipeline-id :pipeline_id --target-url https://github.com/:owner/:repo --output-dir ./tmp/migrate
gh valet migrate azure-devops pipeline --pipeline-id :pipeline_id --target-url https://github.com/:owner/:repo --output-dir tmp/migrate
```
2. The command will write the URL to the pull request that was created when the command succeeds.
```bash
gh valet migrate azure-devops pipeline --pipeline-id 8 --target-url https://github.com/ethanis/labs --output-dir ./tmp/migrate
[2022-09-07 20:25:08] Logs: 'tmp/dry-run-lab/log/valet-20220907-202508.log'
```console
$ gh valet migrate azure-devops pipeline --pipeline-id 8 --target-url https://github.com/ethanis/labs --output-dir tmp/migrate
[2022-09-07 20:25:08] Logs: 'tmp/dry-run/log/valet-20220907-202508.log'
[2022-09-07 20:25:13] Pull request: 'https://github.com/ethanis/labs/pull/42'
```
+23 -21
View File
@@ -12,28 +12,29 @@ These steps **must** be completed prior to starting other labs.
1. Start a new codespace.
- Click the `Code` button on your repository's landing page.
- Click the `Codespaces` tab.
- Click `Create codespaces on main` to create the codespace.
- After the codespace has initialized there will be a terminal present.
- Click the `Code` button on your repository's landing page.
- Click the `Codespaces` tab.
- Click `Create codespaces on main` to create the codespace.
- After the codespace has initialized there will be a terminal present.
2. Verify the Valet CLI is installed and working. More information on the Valet extension for the official GitHub CLI can be found [here](https://github.com/github/gh-valet).
- Run the following command in the codespace terminal:
- Run the following command in the codespace terminal:
```bash
gh valet version
```
```bash
gh valet version
```
- Verify the output is similar to below.
```bash
gh version 2.14.3 (2022-07-26)
gh valet github/gh-valet v0.1.12
valet-cli unknown
```
- Verify the output is similar to below.
- If `gh valet version` did not produce similar output, please refer to the troubleshooting [guide](#troubleshoot-the-valet-cli).
```console
$ gh valet version
gh version 2.14.3 (2022-07-26)
gh valet github/gh-valet v0.1.12
valet-cli unknown
```
- If `gh valet version` did not produce similar output, please refer to the troubleshooting [guide](#troubleshoot-the-valet-cli).
## Bootstrap your Azure DevOps organization
@@ -77,10 +78,10 @@ Perform the following labs to learn how to migrate Azure DevOps pipelines to Git
1. [Configure credentials for Valet](1-configure.md)
2. [Perform an audit of an Azure DevOps project](2-audit.md)
3. [Perform a dry-run migration of an Azure DevOps pipeline](3-dry-run.md)
4. [Use custom transformers to customize Valet's behavior](4-custom-transformers.md)
5. [Perform a production migration of a Azure DevOps pipeline](5-migrate.md)
6. [Forecast potential build runner usage](6-forecast.md)
3. [Forecast potential build runner usage](3-forecast.md)
4. [Perform a dry-run migration of an Azure DevOps pipeline](4-dry-run.md)
5. [Use custom transformers to customize Valet's behavior](5-custom-transformers.md)
6. [Perform a production migration of a Azure DevOps pipeline](6-migrate.md)
## Troubleshoot the Valet CLI
@@ -95,7 +96,8 @@ The CLI extension for Valet can be manually installed by following these steps:
- Verify the result of the install contains:
```bash
```console
$ gh extension install github/gh-valet
✓ Installed extension github/gh-valet
```