From 8377f848f1482c612e805e1f5bb75d4edef84857 Mon Sep 17 00:00:00 2001 From: j-dunham Date: Wed, 31 Aug 2022 16:00:28 -0400 Subject: [PATCH 1/7] Update valet-configure-lab.md --- azure_devops/valet-configure-lab.md | 51 +++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/azure_devops/valet-configure-lab.md b/azure_devops/valet-configure-lab.md index e69de29..9c5ef4e 100644 --- a/azure_devops/valet-configure-lab.md +++ b/azure_devops/valet-configure-lab.md @@ -0,0 +1,51 @@ +# Configure Valet to work with GitLab +In this lab, you will use the Valet `configure` command to set up the required information to communicate with the Azure DevOps and GitHub instances. The `configure` command can be used for all of the supported providers, in this lab we will be focusing on Azure DevOps. +- [Prerequisites](#prerequisites) +- [Configuring Valet](#configuring-valet) +- [Verify Valet Works](#verify-valet-works) +- [Next Lab](#next-lab) + +## Prerequisites +1. Followed [steps](../azure_devops#readme) to set up your codespace environment. + +## Configuring Valet +1. Create a GitHub personal access token (PAT). + - Navigate to your GitHub `Settings` - click your profile photo and then click `Settings`. + - Go to `Developer Settings` + - Go to `Personal Access Tokens` -> `Legacy tokens (if present)` + - Click `Generate new token` -> `Legacy tokens (if present)`. If required, provide your password. + - Select at least these scopes: `read packages` and `workflow`. Optionally, provide a text in the **Note** field and change the expiration. + - Click `Generate token` + - Copy the token somewhere safe and temporary. +2. Skip this step if you still have the Azure DevOp personal access token created during step 1 in the lab setup [steps](../azure_devops#bootstrap-your-azure-devops-organization), if not create another and save to a temporary location. +3. Run Valet configure command. + - In the codespace terminal run `gh valet configure` + - Use the down arrow key to highlight `Azure DevOps`, press the spacebar to select, then hit enter to accept. + - At the prompt enter your GitHub Username and press enter. + - At the GitHub Container Registry prompt enter the GitHub PAT generated in step 1 and press enter + - At the GitHub PAT prompt enter the GitHub PAT generated in step 1 and press enter. + - At the GitHub url prompt enter the GitHub instance url or hit enter to accept the default, if you are using github.com then the default is the right choice. + - At the Azure DevOps token prompt enter the access token from step 2. + - At the Azure DevOps url prompt enter your Azure DevOps url or hit enter to accept the default. + - At the prompt enter your Azure Devops organization name. + - At the prompt enter your Azure Devops project name. +4. If all went well you should see a similar output in your terminal and a new file (.env.local) should have been created in the root of the project. + ADD_SCREEN_SHOT + +## Verify Valet Works +To verify Valet works we are going to run a `update`, `version` and `dry-run` command. We will go further into details about the `dry-run` command in a later lab, but for now we want to get the latest version of Valet and confirm that Valet can perform a dry-run with no errors. + +1. In the codespace terminal update Valet by running `gh valet update` +2. In the terminal you should see a confirmation that it logged into the GitHub Container Registry and pulled the latest version. +3. To verify Valet is updated and installed correctly run `gh valet version` and confirm the command outputs a similar response + ADD_SCREEN_SHOT +4. Next, lets run the dry-run command in the codespaces terminal, to verify we can talk to Azure DevOps + ``` + gh valet dry-run azure-devops pipeline -o tmp/configure_test --pipeline-id 1 + ``` +5. In the terminal you should see the command was successful, if not it is a good time to practice the configure command again and make sure the access tokens values are correct and generated with the correct permissions. + ADD_SCREEN_SHOT + +### Next Lab +[Audit Azure DevOps using the Valet audit command](../azure_devops/valet-audit-lab.md) + From 3af4a36eaba357a2f842854eb0d7f30f7fc24258 Mon Sep 17 00:00:00 2001 From: j-dunham Date: Wed, 31 Aug 2022 16:16:09 -0400 Subject: [PATCH 2/7] Update valet-configure-lab.md --- azure_devops/valet-configure-lab.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/azure_devops/valet-configure-lab.md b/azure_devops/valet-configure-lab.md index 9c5ef4e..80fb97d 100644 --- a/azure_devops/valet-configure-lab.md +++ b/azure_devops/valet-configure-lab.md @@ -30,7 +30,9 @@ In this lab, you will use the Valet `configure` command to set up the required i - At the prompt enter your Azure Devops organization name. - At the prompt enter your Azure Devops project name. 4. If all went well you should see a similar output in your terminal and a new file (.env.local) should have been created in the root of the project. - ADD_SCREEN_SHOT + + ![configure-result](https://user-images.githubusercontent.com/18723510/187771230-27c97889-d98a-48f7-af01-c1a9f8df6423.png) + ## Verify Valet Works To verify Valet works we are going to run a `update`, `version` and `dry-run` command. We will go further into details about the `dry-run` command in a later lab, but for now we want to get the latest version of Valet and confirm that Valet can perform a dry-run with no errors. @@ -38,13 +40,17 @@ To verify Valet works we are going to run a `update`, `version` and `dry-run` co 1. In the codespace terminal update Valet by running `gh valet update` 2. In the terminal you should see a confirmation that it logged into the GitHub Container Registry and pulled the latest version. 3. To verify Valet is updated and installed correctly run `gh valet version` and confirm the command outputs a similar response - ADD_SCREEN_SHOT + + ![valet-version](https://user-images.githubusercontent.com/18723510/187771571-83c0ede3-0b5d-49d5-9cf8-9ff2774ef114.png) + 4. Next, lets run the dry-run command in the codespaces terminal, to verify we can talk to Azure DevOps ``` - gh valet dry-run azure-devops pipeline -o tmp/configure_test --pipeline-id 1 + gh valet dry-run azure-devops pipeline -o tmp/configure_test --pipeline-id 7 ``` 5. In the terminal you should see the command was successful, if not it is a good time to practice the configure command again and make sure the access tokens values are correct and generated with the correct permissions. - ADD_SCREEN_SHOT + + ![dry-run](https://user-images.githubusercontent.com/18723510/187773568-5b4ef731-958f-4e5a-8f50-ea4e8a9e75d4.png) + ### Next Lab [Audit Azure DevOps using the Valet audit command](../azure_devops/valet-audit-lab.md) From 279abafd518c8c621e755c7278ea74b957c6f087 Mon Sep 17 00:00:00 2001 From: j-dunham Date: Wed, 31 Aug 2022 16:20:27 -0400 Subject: [PATCH 3/7] Update valet-configure-lab.md --- azure_devops/valet-configure-lab.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure_devops/valet-configure-lab.md b/azure_devops/valet-configure-lab.md index 80fb97d..a5f6837 100644 --- a/azure_devops/valet-configure-lab.md +++ b/azure_devops/valet-configure-lab.md @@ -14,7 +14,7 @@ In this lab, you will use the Valet `configure` command to set up the required i - Go to `Developer Settings` - Go to `Personal Access Tokens` -> `Legacy tokens (if present)` - Click `Generate new token` -> `Legacy tokens (if present)`. If required, provide your password. - - Select at least these scopes: `read packages` and `workflow`. Optionally, provide a text in the **Note** field and change the expiration. + - Select at least these scopes: `read packages` and `workflow`. Optionally, provide text in the **Note** field and change the expiration. - Click `Generate token` - Copy the token somewhere safe and temporary. 2. Skip this step if you still have the Azure DevOp personal access token created during step 1 in the lab setup [steps](../azure_devops#bootstrap-your-azure-devops-organization), if not create another and save to a temporary location. From 8efd9a34a126bf51885e5064f80abafc567386be Mon Sep 17 00:00:00 2001 From: j-dunham Date: Thu, 1 Sep 2022 08:43:35 -0400 Subject: [PATCH 4/7] Update valet-configure-lab.md --- azure_devops/valet-configure-lab.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/azure_devops/valet-configure-lab.md b/azure_devops/valet-configure-lab.md index a5f6837..5d6048f 100644 --- a/azure_devops/valet-configure-lab.md +++ b/azure_devops/valet-configure-lab.md @@ -1,5 +1,5 @@ # Configure Valet to work with GitLab -In this lab, you will use the Valet `configure` command to set up the required information to communicate with the Azure DevOps and GitHub instances. The `configure` command can be used for all of the supported providers, in this lab we will be focusing on Azure DevOps. +In this lab, we will use the Valet `configure` command to set up the required information to communicate with Azure DevOps and GitHub. The `configure` command can be used for all of the supported providers, but in this lab we will be focusing on Azure DevOps. - [Prerequisites](#prerequisites) - [Configuring Valet](#configuring-valet) - [Verify Valet Works](#verify-valet-works) @@ -17,19 +17,19 @@ In this lab, you will use the Valet `configure` command to set up the required i - Select at least these scopes: `read packages` and `workflow`. Optionally, provide text in the **Note** field and change the expiration. - Click `Generate token` - Copy the token somewhere safe and temporary. -2. Skip this step if you still have the Azure DevOp personal access token created during step 1 in the lab setup [steps](../azure_devops#bootstrap-your-azure-devops-organization), if not create another and save to a temporary location. +2. Skip this step if you still have the Azure DevOp personal access token created during step 1 in the lab setup [steps](../azure_devops#bootstrap-your-azure-devops-organization), if not create another and save to a save and temporary location. 3. Run Valet configure command. - In the codespace terminal run `gh valet configure` - Use the down arrow key to highlight `Azure DevOps`, press the spacebar to select, then hit enter to accept. - - At the prompt enter your GitHub Username and press enter. - - At the GitHub Container Registry prompt enter the GitHub PAT generated in step 1 and press enter + - At the prompt enter your GitHub username and press enter. + - At the GitHub Container Registry prompt enter the GitHub PAT generated in step 1 and press enter. - At the GitHub PAT prompt enter the GitHub PAT generated in step 1 and press enter. - - At the GitHub url prompt enter the GitHub instance url or hit enter to accept the default, if you are using github.com then the default is the right choice. - - At the Azure DevOps token prompt enter the access token from step 2. + - At the GitHub url prompt enter the GitHub instance url or hit enter to accept the default. + - At the Azure DevOps token prompt enter the access token from step 2 and press enter. - At the Azure DevOps url prompt enter your Azure DevOps url or hit enter to accept the default. - - At the prompt enter your Azure Devops organization name. - - At the prompt enter your Azure Devops project name. -4. If all went well you should see a similar output in your terminal and a new file (.env.local) should have been created in the root of the project. + - At the prompt enter your Azure Devops Organization name. + - At the prompt enter your Azure Devops Project name. +4. If all went well you should see a similar output in your terminal and a new file (.env.local) should have been created in the root of the project. The .env.local file contains the tokens used during the configure command and should be keep secret. ![configure-result](https://user-images.githubusercontent.com/18723510/187771230-27c97889-d98a-48f7-af01-c1a9f8df6423.png) From 09dd05a0024bfc463bef8c5c900a939b9b5814ea Mon Sep 17 00:00:00 2001 From: j-dunham Date: Thu, 1 Sep 2022 08:46:15 -0400 Subject: [PATCH 5/7] Update valet-configure-lab.md --- azure_devops/valet-configure-lab.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure_devops/valet-configure-lab.md b/azure_devops/valet-configure-lab.md index 5d6048f..faf7319 100644 --- a/azure_devops/valet-configure-lab.md +++ b/azure_devops/valet-configure-lab.md @@ -1,4 +1,4 @@ -# Configure Valet to work with GitLab +# Configure Valet to work with Azure DevOps In this lab, we will use the Valet `configure` command to set up the required information to communicate with Azure DevOps and GitHub. The `configure` command can be used for all of the supported providers, but in this lab we will be focusing on Azure DevOps. - [Prerequisites](#prerequisites) - [Configuring Valet](#configuring-valet) From 0a218e49859e9470c9fc7bf099830bc813fd4d52 Mon Sep 17 00:00:00 2001 From: j-dunham Date: Thu, 1 Sep 2022 09:00:22 -0400 Subject: [PATCH 6/7] Update valet-configure-lab.md --- azure_devops/valet-configure-lab.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure_devops/valet-configure-lab.md b/azure_devops/valet-configure-lab.md index faf7319..b50a150 100644 --- a/azure_devops/valet-configure-lab.md +++ b/azure_devops/valet-configure-lab.md @@ -1,4 +1,4 @@ -# Configure Valet to work with Azure DevOps +# Configure credentials for Valet In this lab, we will use the Valet `configure` command to set up the required information to communicate with Azure DevOps and GitHub. The `configure` command can be used for all of the supported providers, but in this lab we will be focusing on Azure DevOps. - [Prerequisites](#prerequisites) - [Configuring Valet](#configuring-valet) From 7061b52e8d874aef1b5f1aa16ea00bd25d858ba2 Mon Sep 17 00:00:00 2001 From: j-dunham Date: Thu, 1 Sep 2022 09:01:36 -0400 Subject: [PATCH 7/7] Update readme.md --- azure_devops/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure_devops/readme.md b/azure_devops/readme.md index 3c9505e..b77f362 100644 --- a/azure_devops/readme.md +++ b/azure_devops/readme.md @@ -59,7 +59,7 @@ This lab bootstraps a Valet environment using GitHub Codespaces and enables you ## Labs for Azure DevOps Perform the following labs to learn how to migrate Azure DevOps pipelines to GitHub Actions using Valet: - +- [Configure credentials for Valet](valet-configure-lab.md) - [Audit Azure DevOps pipelines using the Valet audit command](valet-audit-lab.md) - [Dry run the migration of an Azure DevOps pipeline to GitHub Actions](valet-dry-run-lab.md) - [Migrate an Azure DevOps pipeline to GitHub Actions](valet-migrate-lab.md)