From ba5378580431e26661ac5ad6457128c4d98c714f Mon Sep 17 00:00:00 2001 From: Matisse Hack Date: Fri, 10 Jun 2022 20:31:36 +0000 Subject: [PATCH 1/4] Consistent output directories --- azure_devops/valet-audit-lab.md | 2 +- azure_devops/valet-dry-run-lab.md | 2 +- azure_devops/valet-migrate-lab.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/azure_devops/valet-audit-lab.md b/azure_devops/valet-audit-lab.md index cbd9ca3..5ae8e8a 100644 --- a/azure_devops/valet-audit-lab.md +++ b/azure_devops/valet-audit-lab.md @@ -32,7 +32,7 @@ You will use the codespace preconfigured in this repository to perform the audit 3. Now, from the `valet` folder in your repository, run Valet to verify your Azure DevOps configuration: ``` -gh valet audit azure-devops --output-dir . +gh valet audit azure-devops --output-dir audit ``` ### Example ![valet-audit-1](https://user-images.githubusercontent.com/26442605/169615028-696dad13-ff83-41a7-b475-0ab8c0bbcd65.png) diff --git a/azure_devops/valet-dry-run-lab.md b/azure_devops/valet-dry-run-lab.md index 73730d4..fbdea4d 100644 --- a/azure_devops/valet-dry-run-lab.md +++ b/azure_devops/valet-dry-run-lab.md @@ -42,7 +42,7 @@ You will use the codespace preconfigured in this repository to perform the dry r 2. Verify you are in the `valet` directory ``` -gh valet dry-run azure-devops pipeline --pipeline-id PIPELINE-ID --output-dir dry-runs +gh valet dry-run azure-devops pipeline --pipeline-id PIPELINE-ID --output-dir dry-run ``` 3. Now, from the `valet` folder in your repository, run `gh valet dry-run` to see the output: diff --git a/azure_devops/valet-migrate-lab.md b/azure_devops/valet-migrate-lab.md index d51dd6d..5053627 100644 --- a/azure_devops/valet-migrate-lab.md +++ b/azure_devops/valet-migrate-lab.md @@ -48,7 +48,7 @@ You will use the codespace preconfigured in this repository to perform the migra 4. Now, from the `./valet` folder in your repository, run `valet migrate` to migrate the pipeline to GitHub Actions. ``` cd valet -gh valet migrate azure-devops pipeline --target-url https://github.com/GITHUB-ORG/GITHUB-REPO --pipeline-id PIPELINE-ID --output-dir migrations +gh valet migrate azure-devops pipeline --target-url https://github.com/GITHUB-ORG/GITHUB-REPO --pipeline-id PIPELINE-ID --output-dir migrate ``` ### Example From 9e24b01628af91bf023495ca5c9341013f35d7a7 Mon Sep 17 00:00:00 2001 From: Matisse Hack Date: Fri, 10 Jun 2022 20:33:35 +0000 Subject: [PATCH 2/4] Format Ruby code blocks --- azure_devops/valet-migrate-custom-lab.md | 35 ++++++++++++------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/azure_devops/valet-migrate-custom-lab.md b/azure_devops/valet-migrate-custom-lab.md index ccf7a3b..7f38673 100644 --- a/azure_devops/valet-migrate-custom-lab.md +++ b/azure_devops/valet-migrate-custom-lab.md @@ -41,8 +41,8 @@ You will need the `valet-mapper-example` Azure DevOps pipeline ID to perform the To create a transformer, you need to create a Ruby file that looks as follows: ``` ruby transform "azuredevopstaskname" do |item| - # your ruby code here that produces output - end + # your ruby code here that produces output +end ``` We start by creating a new folder called `plugin` under the `valet` folder in your repository. In there create a file called `DotNetCoreCLI.rb`. @@ -53,8 +53,8 @@ The way you find this name is by clicking the **view yaml** button at a task in This results in the following code: ``` ruby transform "DotNetCoreCLI@2" do |item| - # your ruby code here that produces output - end + # your ruby code here that produces output +end ``` The parameter item is a collection of items than contain the properties of the original task that was retrieved from Azure DevOps. In this case we can see in the yaml that the properties that are set are `command` and `projects`. @@ -63,21 +63,20 @@ Add the following code to the ruby file: ``` Ruby transform "DotNetCoreCLI@2" do |item| projects = item["projects"] - command = item['command'] + command = item["command"] run_command = [] - - if(projects.include?("$")) - if(command.nil?) - command = "build" - end - run_command << "shopt -s globstar; for f in ./**/*.csproj; do dotnet #{command} $f #{item['arguments'] } ; done" - else - run_command << "dotnet #{command} #{item['projects']} #{item['arguments'] }" - end - { - shell: "bash", - run: run_command.join("\n") - } + + if projects.include?("$") + command = "build" if command.nil? + run_command << "shopt -s globstar; for f in ./**/*.csproj; do dotnet #{command} $f #{item['arguments']} ; done" + else + run_command << "dotnet #{command} #{item['projects']} #{item['arguments']}" + end + + { + shell: "bash", + run: run_command.join("\n") + } end ``` ### Example From 34671f064d3666c413e92d49e551e7667db79ce9 Mon Sep 17 00:00:00 2001 From: Matisse Hack Date: Fri, 10 Jun 2022 23:42:57 +0000 Subject: [PATCH 3/4] Remove image --- azure_devops/valet-migrate-custom-lab.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/azure_devops/valet-migrate-custom-lab.md b/azure_devops/valet-migrate-custom-lab.md index 7f38673..a0f64e9 100644 --- a/azure_devops/valet-migrate-custom-lab.md +++ b/azure_devops/valet-migrate-custom-lab.md @@ -79,8 +79,6 @@ transform "DotNetCoreCLI@2" do |item| } end ``` -### Example -![mapper-ex1](https://user-images.githubusercontent.com/26442605/161116232-c3dab5ba-8ca5-4dd0-a659-b871646ab82f.png) Run the `migrate` command with the transformer again and pass it the custom plugin. Look at the result and see if it results in a successful build. From be596e73946b9ac93646ebf02d1f495adfa930a3 Mon Sep 17 00:00:00 2001 From: Matisse Hack Date: Fri, 17 Jun 2022 14:51:29 -0700 Subject: [PATCH 4/4] Update azure_devops/valet-migrate-custom-lab.md Co-authored-by: Ethan Dennis --- azure_devops/valet-migrate-custom-lab.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure_devops/valet-migrate-custom-lab.md b/azure_devops/valet-migrate-custom-lab.md index a0f64e9..97c3654 100644 --- a/azure_devops/valet-migrate-custom-lab.md +++ b/azure_devops/valet-migrate-custom-lab.md @@ -71,7 +71,7 @@ transform "DotNetCoreCLI@2" do |item| run_command << "shopt -s globstar; for f in ./**/*.csproj; do dotnet #{command} $f #{item['arguments']} ; done" else run_command << "dotnet #{command} #{item['projects']} #{item['arguments']}" - end + end { shell: "bash",