Readme edits
This commit is contained in:
+31
-30
@@ -6,14 +6,15 @@ 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).
|
||||
1. __Note__: you may skip this step if you still have the PAT created during the setup steps [here](./readme.md#bootstrap-your-azure-devops-organization).
|
||||
2. Navigate to your existing organization (<https://dev.azure.com/:organization>) in your browser.
|
||||
3. Click `User settings` in the top right corner of the screen.
|
||||
4. Click `Personal access tokens`.
|
||||
5. Select `+ New Token`
|
||||
6. Name your token, select the organization where you want to use the token, and set your token to automatically expire after a set number of days.
|
||||
7. Select the following scopes (you may need to `Show more scopes` to reveal all scopes):
|
||||
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`.
|
||||
- Click `Personal access tokens`.
|
||||
- Select `+ New Token`
|
||||
- Name your token, select the organization where you want to use the token, and set your token to automatically expire after a set number of days.
|
||||
- Select the following scopes (you may need to `Show more scopes` to reveal all scopes):
|
||||
- Agents Pool: `Read`
|
||||
- Build: `Read & Execute`
|
||||
- Code: `Read & Write`
|
||||
@@ -22,38 +23,38 @@ You will need to complete all of the setup instructions [here](./readme.md#confi
|
||||
- Service Connections: `Read`
|
||||
- Task Groups: `Read`
|
||||
- Variable Groups: `Read`
|
||||
8. Click `Create`.
|
||||
9. Copy the generated API token and save in a safe location.
|
||||
- Click `Create`.
|
||||
- Copy the generated API token and save it in a safe location.
|
||||
|
||||
2. Create a GitHub Personal Access Token (PAT):
|
||||
1. Open github.com in a new browser tab.
|
||||
2. Click your profile photo in the top right of the UI and click `Settings`.
|
||||
3. Click on `Developer Settings` in the left hand panel.
|
||||
4. Click `Personal Access Tokens` and then `Legacy tokens` (if present).
|
||||
5. Click `Generate new token` and then `Legacy tokens`. You may be required to authenticate with GitHub during this step.
|
||||
6. Select the following scopes: `read:packages` and `workflow`.
|
||||
7. Click `Generate token`.
|
||||
8. Copy the generated PAT and save in a safe location.
|
||||
2. Create a GitHub personal access token (PAT):
|
||||
- Open github.com in a new browser tab.
|
||||
- In the top right corner of the UI, click your profile photo and then click `Settings`.
|
||||
- In the left panel, click `Developer Settings`.
|
||||
- Click `Personal access tokens` and then `Legacy tokens` (if present).
|
||||
- Click `Generate new token` and then `Generate new legacy token`. You may be required to authenticate with GitHub during this step.
|
||||
- Select the following scopes: `workflow` and `read:packages`.
|
||||
- Click `Generate token`.
|
||||
- Copy the generated PAT and save it in a safe location.
|
||||
|
||||
3. Run the `configure` CLI command:
|
||||
- Select the `TERMINAL` tab from within the codespace terminal window.
|
||||
- Select the `TERMINAL` tab from within the codespace terminal.
|
||||
- Run the following command: `gh valet configure`.
|
||||
- Using the down arrow key to highlight `Azure DevOps`, press the spacebar to select, and then hit enter to continue.
|
||||
- At the GitHub Container Registry prompt enter the GitHub PAT generated in step 2 and press enter.
|
||||
- At the GitHub PAT prompt enter the GitHub PAT generated in step 2 and press enter.
|
||||
- At the GitHub url prompt enter the GitHub instance url or hit enter to accept the default value (`https://github.com`).
|
||||
- At the Azure DevOps token prompt enter the access token from step 1 and press enter.
|
||||
- At the Azure DevOps url prompt enter your Azure DevOps url or hit enter to accept the default value (`https://dev.azure.com`).
|
||||
- At the prompt enter your Azure Devops organization name. This should be the same organization used in the setup steps [here](./readme.md#bootstrap-your-azure-devops-organization).
|
||||
- At the prompt enter your Azure Devops project name. This should be the same project name used in the setup steps [here](./readme.md#bootstrap-your-azure-devops-organization).
|
||||
- Use the down arrow key to highlight `Azure DevOps`, press the spacebar to select, and then press enter to continue.
|
||||
- At the GitHub Container Registry prompt, enter the GitHub PAT generated in step 2 and press enter.
|
||||
- At the GitHub PAT prompt, enter the GitHub PAT generated in step 2 and press enter.
|
||||
- At the GitHub URL prompt, enter the GitHub instance URL or press enter to accept the default value (`https://github.com`).
|
||||
- At the Azure DevOps token prompt, enter the access token from step 1 and press enter.
|
||||
- At the Azure DevOps URL prompt, enter your Azure DevOps URL or press enter to accept the default value (`https://dev.azure.com`).
|
||||
- At the prompt, enter your Azure DevOps organization name. This should be the same organization used in the setup steps [here](./readme.md#bootstrap-your-azure-devops-organization).
|
||||
- At the prompt, enter your Azure DevOps project name. This should be the same project name used in the setup steps [here](./readme.md#bootstrap-your-azure-devops-organization).
|
||||
|
||||

|
||||
|
||||
## Verify your environment
|
||||
|
||||
To verify our environment is configured correctly, we are going to run the `update` CLI command. The `update` CLI command will download the latest version of Valet to your codespace.
|
||||
To verify our environment is configured correctly, run the `update` CLI command. The `update` CLI command will download the latest version of Valet to your codespace.
|
||||
|
||||
1. In the codespace terminal run the following command:
|
||||
1. In the codespace terminal, run the following command:
|
||||
|
||||
```bash
|
||||
gh valet update
|
||||
|
||||
+10
-10
@@ -6,21 +6,21 @@ The `audit` command operates by fetching all of the pipelines defined in an Azur
|
||||
|
||||
## Prerequisites
|
||||
|
||||
1. Followed the steps [here](./readme.md#configure-your-codespace) to set up your Codespace environment and bootstrap an Azure DevOps project.
|
||||
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.md#configuring-credentials).
|
||||
|
||||
## Perform an audit
|
||||
|
||||
We will be performing an audit against the bootstrapped Azure DevOps project. We will need to answer the following questions before running this command:
|
||||
You will now perform an audit against the bootstrapped Azure DevOps project. Answer the following questions before running this command:
|
||||
|
||||
1. What is the Azure DevOps organization name that we want to audit?
|
||||
1. What is the Azure DevOps organization name that you want to audit?
|
||||
- __:organization__. This should be the same organization used in the setup steps [here](./readme.md#bootstrap-your-azure-devops-organization)
|
||||
|
||||
2. What is the Azure DevOps project name that we want to audit?
|
||||
2. What is the Azure DevOps project name that you want to audit?
|
||||
- __:project__. This should be the same project name used in the setup steps [here](./readme.md#bootstrap-your-azure-devops-organization)
|
||||
|
||||
3. Where do we want to store the result?
|
||||
- __./tmp/audit__. This can be any path within the working directory that Valet commands are executed from.
|
||||
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.
|
||||
|
||||
### Steps
|
||||
|
||||
@@ -31,7 +31,7 @@ We will be performing an audit against the bootstrapped Azure DevOps project. We
|
||||
gh valet audit azure-devops --output-dir tmp/audit --namespace valet
|
||||
```
|
||||
|
||||
__Note__: The Azure DevOps organization and project name can be omitted from the `audit` command as 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.
|
||||
__Note__: The Azure DevOps organization and project name can be omitted from the `audit` 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.
|
||||
|
||||
3. The command will list all the files written to disk in green when the command succeeds.
|
||||
|
||||
@@ -39,7 +39,7 @@ We will be performing an audit against the bootstrapped Azure DevOps project. We
|
||||
|
||||
1. Find the `audit_summary.md` file in the file explorer.
|
||||
2. Right-click the `audit_summary.md` file and select `Open Preview`.
|
||||
3. This file contains details that summarizes what percentage of your pipelines were converted automatically.
|
||||
3. This file contains details that summarize what percentage of your pipelines were converted automatically.
|
||||
|
||||
### Review audit summary
|
||||
|
||||
@@ -73,7 +73,7 @@ Here are some key terms in the "Pipelines" section in the above example:
|
||||
- Classic (designer)
|
||||
- YAML
|
||||
- Release
|
||||
- __Failed pipelines__ encountered a fatal error when being converted. This can occur for one of three reasons:
|
||||
- __Failed__ pipelines encountered a fatal error when being converted. This can occur for one of three reasons:
|
||||
- The pipeline was misconfigured and not valid in Azure DevOps.
|
||||
- Valet encountered an internal error when converting it.
|
||||
- There was an unsuccessful network response, often due to invalid credentials, that caused the pipeline to be inaccessible.
|
||||
@@ -172,4 +172,4 @@ Each pipeline will have a variety of files written that include:
|
||||
|
||||
### Next lab
|
||||
|
||||
[Perform a dry-run of an Azure DevOps pipeline](3-dry-run.md)
|
||||
[Perform a dry-run migration of an Azure DevOps pipeline](3-dry-run.md)
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
# Perform a dry-run of an Azure DevOps pipeline
|
||||
# Perform a dry-run migration of an Azure DevOps pipeline
|
||||
|
||||
In this lab you will use the `dry-run` command to convert an Azure DevOps pipeline to its equivalent GitHub Actions workflow.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
1. Followed the steps [here](./readme.md#configure-your-codespace) to set up your Codespace environment and bootstrap an Azure DevOps project.
|
||||
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 [audit lab](./2-audit.md).
|
||||
|
||||
## Perform a dry run
|
||||
|
||||
We will be performing a dry-run for a pipeline in the bootstrapped Azure DevOps project. We will need to answer the following questions before running this command:
|
||||
You will perform a dry run for a pipeline in the bootstrapped Azure DevOps project. Answer the following questions before running this command:
|
||||
|
||||
1. What is the id of the pipeline to convert?
|
||||
- __:id__. This id can be found by:
|
||||
@@ -18,12 +18,12 @@ We will be performing a dry-run for a pipeline in the bootstrapped Azure DevOps
|
||||
- Selecting the pipeline with the name "valet-pipeline1"
|
||||
- Inspecting the URL to locate the pipeline id <https://dev.azure.com/:organization/:project/_build?definitionId=:pipeline_id>
|
||||
|
||||
2. Where do we want to store the result?
|
||||
- __./tmp/dry-run-lab__. This can be any path within the working directory that Valet commands are executed from.
|
||||
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.
|
||||
|
||||
### Steps
|
||||
|
||||
1. Navigate to the codespace terminal.
|
||||
1. Navigate to your codespace terminal.
|
||||
2. Run the following command from the root directory:
|
||||
|
||||
```bash
|
||||
@@ -32,7 +32,7 @@ We will be performing a dry-run for a pipeline in the bootstrapped Azure DevOps
|
||||
|
||||
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 codespaces.
|
||||
- Find `./tmp/dry-run-lab` in the file explorer pane in your codespace.
|
||||
- Click `valet-pipeline1.yml` to open.
|
||||
|
||||
## Inspect the output files
|
||||
@@ -86,7 +86,7 @@ jobs:
|
||||
|
||||
</details>
|
||||
|
||||
Despite these 2 pipelines using different syntax they will function equivalently.
|
||||
Despite these two pipelines using different syntax they will function equivalently.
|
||||
|
||||
## Next lab
|
||||
|
||||
|
||||
@@ -9,14 +9,14 @@ 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 Codespace environment and bootstrap an Azure DevOps project.
|
||||
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 [audit lab](./2-audit.md).
|
||||
4. Completed the [dry-run lab](./3-dry-run.md).
|
||||
|
||||
## Perform a dry run
|
||||
|
||||
We will be performing a dry-run for a pipeline in the bootstrapped Azure DevOps project. We will need to answer the following questions before running this command:
|
||||
You will perform a dry-run for a pipeline in the bootstrapped Azure DevOps project. Answer the following questions before running this command:
|
||||
|
||||
1. What is the id of the pipeline to convert?
|
||||
- __:pipeline_id__. This id can be found by:
|
||||
@@ -24,8 +24,8 @@ We will be performing a dry-run for a pipeline in the bootstrapped Azure DevOps
|
||||
- Selecting the pipeline with the name "valet-custom-transformer-example"
|
||||
- Inspecting the URL to locate the pipeline id <https://dev.azure.com/:organization/:project/_build?definitionId=:pipeline_id>
|
||||
|
||||
2. Where do we want to store the result?
|
||||
- __./tmp/dry-run-lab__. This can be any path within the working directory that Valet commands are executed from.
|
||||
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.
|
||||
|
||||
### Steps
|
||||
|
||||
@@ -38,7 +38,7 @@ We will be performing a dry-run for a pipeline in the bootstrapped Azure DevOps
|
||||
|
||||
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 codespaces.
|
||||
- Find `./tmp/dry-run-lab` 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:
|
||||
@@ -81,26 +81,26 @@ _Note_: You can refer to the previous [lab](./3-dry-run.md) to learn about the f
|
||||
|
||||
## Custom transformers for build steps
|
||||
|
||||
We can use custom transformers to override Valet's default behavior. In this scenario, we may want to override the behavior for converting `DotnetCoreCLI@2` tasks to support parameters that are glob patterns. We will need to answer the following questions before writing a custom transformer:
|
||||
You can use custom transformers to override Valet's default behavior. In this scenario, you may want to override the behavior for converting `DotnetCoreCLI@2` tasks to support parameters that are glob patterns. Answer the following questions before writing a custom transformer:
|
||||
|
||||
1. What is the "identifier" of the step to customize?
|
||||
- __DotnetCoreCLI@2__
|
||||
|
||||
2. What is the desired Actions syntax to use instead?
|
||||
- After some research, we have determined that the uploading test results as an artifact will be suitable:
|
||||
- After some research, you have determined that the uploading test results as an artifact will be suitable:
|
||||
|
||||
```yaml
|
||||
- run: shopt -s globstar; for f in ./**/*.csproj; do dotnet build $f --configuration ${{ env.BUILDCONFIGURATION }} ; done
|
||||
shell: bash
|
||||
```
|
||||
|
||||
Now we can begin to write the custom transformer. Customer transformers use a DSL built on top of Ruby and should be defined in a file with the `.rb` file extension. You can create this file by running the following command in your codespace terminal:
|
||||
Now you can begin to write the custom transformer. Customer transformers use a DSL built on top of Ruby and should be defined in a file with the `.rb` file extension. You can create this file by running the following command in your codespace terminal:
|
||||
|
||||
```bash
|
||||
code transformers.rb
|
||||
```
|
||||
|
||||
Next, we will define a `transform` method for the `DotnetCoreCLI@2` identifier by adding the following code to `transformers.rb`:
|
||||
Next, you will define a `transform` method for the `DotnetCoreCLI@2` identifier by adding the following code to `transformers.rb`:
|
||||
|
||||
```ruby
|
||||
transform "DotNetCoreCLI@2" do |item|
|
||||
@@ -124,13 +124,13 @@ end
|
||||
|
||||
This method can use any valid ruby syntax and should return a `Hash` that represents the YAML that should be generated for a given step. Valet will use this method to convert a step with the provided identifier and will use the `item` parameter for the original values configured in Azure DevOps.
|
||||
|
||||
Now, we 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:
|
||||
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 -o tmp/dry-run-lab --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!
|
||||
Open the workflow that is generated and inspect the contents. Now the `DotnetCoreCLI@2` steps are converted using the customized behavior!
|
||||
|
||||
```diff
|
||||
- - name: Restore
|
||||
@@ -147,7 +147,7 @@ Open the workflow that is generated and inspect the contents. Now, the `DotnetCo
|
||||
|
||||
## Custom transformers for environment variables
|
||||
|
||||
We can also use custom transformers to edit the values of environment variables in converted workflows. In our example, we will be updating the `BUILDCONFIGURATION` environment variable to be `Debug` instead of `Release`.
|
||||
You can also use custom transformers to edit the values of environment variables in converted workflows. In this example, you will be updating the `BUILDCONFIGURATION` environment variable to be `Debug` instead of `Release`.
|
||||
|
||||
To do this, add the following code to the `transformers.rb` file.
|
||||
|
||||
@@ -157,7 +157,7 @@ env "BUILDCONFIGURATION", "Debug"
|
||||
|
||||
In this example, the first parameter to the `env` method is the environment variable name and the second is the updated value.
|
||||
|
||||
Now, we can perform another `dry-run` command with the `--custom-transformers` CLI option. When you open the converted workflow the `DB_ENGINE` environment variable will be set to `mongodb`:
|
||||
Now you can perform another `dry-run` command with the `--custom-transformers` CLI option. When you open the converted workflow, the `DB_ENGINE` environment variable will be set to `mongodb`:
|
||||
|
||||
```diff
|
||||
env:
|
||||
@@ -168,7 +168,7 @@ env:
|
||||
|
||||
## Custom transformers for runners
|
||||
|
||||
Finally, we can use custom transformers to dictate which runners converted workflows should use. To do this we will need to answer the following questions:
|
||||
Finally, you can use custom transformers to dictate which runners converted workflows should use. First, answer the following questions:
|
||||
|
||||
1. What is the label of the runner in Azure DevOps to update?
|
||||
- __mechamachine__
|
||||
@@ -176,7 +176,7 @@ Finally, we can use custom transformers to dictate which runners converted workf
|
||||
2. What is the label of the runner in Actions to use instead?
|
||||
- __ubuntu-latest__
|
||||
|
||||
With these questions answered, we can add the following code to the `transformers.rb` file:
|
||||
With these questions answered, you can add the following code to the `transformers.rb` file:
|
||||
|
||||
```ruby
|
||||
runner "mechamachine", "ubuntu-latest"
|
||||
@@ -184,7 +184,7 @@ runner "mechamachine", "ubuntu-latest"
|
||||
|
||||
In this example, the first parameter to the `runner` method is the Azure DevOps label and the second is the Actions runner label.
|
||||
|
||||
Now, we can perform another `dry-run` command with the `--custom-transformers` CLI option. When you open the converted workflow the `runs-on` statement will use the customized runner label:
|
||||
Now you can perform another `dry-run` command with the `--custom-transformers` CLI option. When you open the converted workflow, the `runs-on` statement will use the customized runner label:
|
||||
|
||||
```diff
|
||||
- runs-on:
|
||||
@@ -193,7 +193,7 @@ Now, we can perform another `dry-run` command with the `--custom-transformers` C
|
||||
+ runs-on: ubuntu-latest
|
||||
```
|
||||
|
||||
At this point of the lab the file contents of `transformers.rb` should match this:
|
||||
At this point, the file contents of `transformers.rb` should match this:
|
||||
|
||||
<details>
|
||||
<summary><em>Custom transformers 👇</em></summary>
|
||||
@@ -224,7 +224,7 @@ runner "mechamachine", "ubuntu-latest"
|
||||
|
||||
</details>
|
||||
|
||||
Thats it! At this point you have overridden Valet's default behavior by customizing the conversion of:
|
||||
That's it! At this point you have overridden Valet's default behavior by customizing the conversion of:
|
||||
|
||||
- Build steps
|
||||
- Environment variables
|
||||
|
||||
@@ -4,21 +4,21 @@ 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 Codespace environment and bootstrap an Azure DevOps project.
|
||||
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).
|
||||
|
||||
## Performing a migration
|
||||
|
||||
We need to answer the following questions before running a `migrate` command:
|
||||
Answer the following questions before running a `migrate` command:
|
||||
|
||||
1. What is the id of the pipeline to convert?
|
||||
- __:pipeline_id__. This id can be found by:
|
||||
- Navigating to the build pipelines in the bootstrapped Azure DevOps project <https://dev.azure.com/:organization/:project/_build>
|
||||
- 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 we want to store the logs?
|
||||
2. Where do you want to store the logs?
|
||||
- __./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.
|
||||
@@ -43,13 +43,13 @@ We need to answer the following questions before running a `migrate` command:
|
||||
|
||||
### 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:
|
||||
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 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.
|
||||
Next, you can inspect the `Files changed` in this pull request to 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 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.
|
||||
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.
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -4,20 +4,20 @@ 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 Codespace environment and bootstrap an Azure DevOps project.
|
||||
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).
|
||||
|
||||
## Perform a forecast
|
||||
|
||||
We will need to answer the following questions before running the `forecast` command:
|
||||
Answer the following questions before running the `forecast` command:
|
||||
|
||||
1. What is the Azure DevOps organization name that we want to audit?
|
||||
1. What is the Azure DevOps organization name that you want to audit?
|
||||
- __:organization__. This should be the same organization used in the setup steps [here](./readme.md#bootstrap-your-azure-devops-organization)
|
||||
|
||||
2. What is the Azure DevOps project name that we want to audit?
|
||||
2. What is the Azure DevOps project name that you want to audit?
|
||||
- __:project__. This should be the same project name used in the setup steps [here](./readme.md#bootstrap-your-azure-devops-organization)
|
||||
|
||||
3. Where do we want to store the results?
|
||||
3. Where do you want to store the results?
|
||||
- `./tmp/forecast_reports`
|
||||
|
||||
### Steps
|
||||
@@ -33,7 +33,7 @@ We will need to answer the following questions before running the `forecast` com
|
||||
|
||||

|
||||
|
||||
4. If you inspect the help menu using the `gh valet forecast --help` command then you will see a `--source-file-path` option. This option can be used to perform a `forecast` command using json files that are already present on the filesystem. These labs come bundled with sample json files located [here](./bootstrap/jobs.json).
|
||||
4. If you inspect the help menu using the `gh valet forecast --help` command, you will see a `--source-file-path` option. You can use this option to perform a `forecast` command using json files that are already present on the filesystem. These labs come bundled with sample json files located [here](./bootstrap/jobs.json).
|
||||
|
||||

|
||||
|
||||
@@ -91,7 +91,7 @@ Here are some key terms of items defined in the forecast report:
|
||||
- The `Job count` is the total number of completed jobs.
|
||||
- The `Pipeline count` is the number of unique pipelines used.
|
||||
- `Execution time` describes the amount of time a runner spent on a job. This metric can be used to help plan for the cost of GitHub hosted runners.
|
||||
- This metric is correlated to how much you should expect to spend in GitHub Actions. This will vary depending on the hardware used for these minutes and the [Actions pricing calculator](https://github.com/pricing/calculator) should be used to estimate a dollar amount.
|
||||
- This metric is correlated to how much you should expect to spend in GitHub Actions. This will vary depending on the hardware used for these minutes. You can use the [Actions pricing calculator](https://github.com/pricing/calculator) to estimate a dollar amount.
|
||||
- `Queue time` metrics describe the amount of time a job spent waiting for a runner to be available to execute it.
|
||||
- `Concurrent jobs` metrics describe the amount of jobs running at any given time. This metric can be used to define the number of runners a customer should configure.
|
||||
|
||||
|
||||
+15
-15
@@ -1,25 +1,25 @@
|
||||
# Azure Pipelines to Actions migrations powered by Valet
|
||||
|
||||
The instructions below will guide you through configuring a Codespace that will be used in these labs to demonstrate how Valet can be used to migrate Azure DevOps pipelines to GitHub Actions.
|
||||
These instructions will guide you through configuring the GitHub Codespaces environment that will be used in these labs to demonstrate how to use Valet to migrate Azure DevOps pipelines to GitHub Actions.
|
||||
|
||||
These steps **must** be completed prior to starting other labs.
|
||||
|
||||
## Create your own repository for these labs
|
||||
|
||||
1. Ensure that you have created a repository using the [valet-customers/labs](https://github.com/valet-customers/labs) as a template.
|
||||
- Ensure that you have created a repository using [valet-customers/labs](https://github.com/valet-customers/labs) as a template.
|
||||
|
||||
## Configure your Codespace
|
||||
## Configure your codespace
|
||||
|
||||
1. Start a new Codespace.
|
||||
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.
|
||||
- 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's terminal:
|
||||
- Run the following command in the codespace terminal:
|
||||
|
||||
```bash
|
||||
gh valet version
|
||||
@@ -33,14 +33,14 @@ These steps **must** be completed prior to starting other labs.
|
||||
valet-cli unknown
|
||||
```
|
||||
|
||||
- If `gh valet version` did not produce similar output then please follow the troubleshooting [guide](#troubleshoot-the-valet-cli).
|
||||
- If `gh valet version` did not produce similar output, please refer to the troubleshooting [guide](#troubleshoot-the-valet-cli).
|
||||
|
||||
## Bootstrap your Azure DevOps organization
|
||||
|
||||
1. Create an Azure DevOps personal access token:
|
||||
1. Create an Azure DevOps personal access token (PAT):
|
||||
|
||||
- Navigate to your existing organization (<https://dev.azure.com/:organization>) in your browser.
|
||||
- Click `User settings` in the top right corner of the screen.
|
||||
- In the top right corner of the screen, click `User settings`.
|
||||
- Click `Personal access tokens`.
|
||||
- Select `+ New Token`
|
||||
- Name your token, select the organization where you want to use the token, and set your token to automatically expire after a set number of days.
|
||||
@@ -54,11 +54,11 @@ These steps **must** be completed prior to starting other labs.
|
||||
- Task Groups: `Read`
|
||||
- Variable Groups: `Read`
|
||||
- Click `Create`.
|
||||
- Copy the generated API token and save in a safe location.
|
||||
- Copy the generated API token and save it in a safe location.
|
||||
|
||||
2. Execute the Azure DevOps setup script that will create a new Azure DevOps project in your organization to be used in the following labs. This script should only be run once.
|
||||
|
||||
- Run the following command from the codespace's terminal, replacing the values accordingly:
|
||||
- Run the following command from the codespace terminal, replacing the values accordingly:
|
||||
- `:organization`: the name of your existing Azure DevOps organization
|
||||
- `:project`: the name of the project to be created in your Azure DevOps organization
|
||||
- `:access_token`: the PAT created in step 1 above
|
||||
@@ -77,7 +77,7 @@ 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 of a Azure DevOps pipeline](3-dry-run.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)
|
||||
@@ -87,7 +87,7 @@ Perform the following labs to learn how to migrate Azure DevOps pipelines to Git
|
||||
The CLI extension for Valet can be manually installed by following these steps:
|
||||
|
||||
- Verify you are in the codespace terminal
|
||||
- Run this command from within the codespace's terminal:
|
||||
- Run this command from within the codespace terminal:
|
||||
|
||||
```bash
|
||||
gh extension install github/gh-valet
|
||||
@@ -99,10 +99,10 @@ The CLI extension for Valet can be manually installed by following these steps:
|
||||
✓ Installed extension github/gh-valet
|
||||
```
|
||||
|
||||
- If you get an error similar to the image below, then click the link in the terminal output to authorize the token.
|
||||
- If you get an error similar to the image below, click the link in the terminal output to authorize the token.
|
||||
- Restart the codespace after clicking the link.
|
||||

|
||||
- Verify Valet CLI extension is installed and working by running the following command from the codespace's terminal:
|
||||
- Verify Valet CLI extension is installed and working by running the following command from the codespace terminal:
|
||||
|
||||
```bash
|
||||
gh valet version
|
||||
|
||||
Reference in New Issue
Block a user