Merge branch 'feature/circleci-labs' of https://github.com/valet-customers/labs into luke-edits

This commit is contained in:
Luke Engle
2022-09-20 12:42:45 -07:00
18 changed files with 1201 additions and 147 deletions
+51 -39
View File
@@ -7,50 +7,62 @@ 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`.
- 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 all scopes` to reveal all scopes):
- Agents Pool: `Read`
- Build: `Read & execute`
- Code: `Read & write`
- Project and Team: `Read, write, & manage`
- Release: `Read`
- Service Connections: `Read`
- Task Groups: `Read`
- Variable Groups: `Read`
- Click `Create`.
- Copy the generated API token and save it in a safe location.
__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 all scopes` to reveal all scopes):
- Agents Pool: `Read`
- Build: `Read & execute`
- Code: `Read & write`
- Project and Team: `Read, write, & manage`
- Release: `Read`
- Service Connections: `Read`
- Task Groups: `Read`
- Variable Groups: `Read`
- Click `Create`.
- Copy the generated API token and save it 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.
- Name your token in the `Note` field.
- Select the following scopes: `workflow` and `read:packages`.
- Click `Generate token`.
- Copy the generated PAT and save it in a safe location.
- 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.
- Name your token in the `Note` field.
- 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.
- Run the following command: `gh valet configure`.
- Use the down arrow key to highlight `Azure DevOps`, press the spacebar to select, and then press enter to continue.
- At the GitHub handle prompt, enter the GitHub handle used to generate the GitHub PAT in step 2 and press enter.
- 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).
- Select the `TERMINAL` tab from within the codespace terminal.
- Run the following command: `gh valet configure`.
- Use the down arrow key to highlight `Azure DevOps`, press the spacebar to select, and then press enter to continue.
- At the GitHub handle prompt, enter the GitHub handle used to generate the GitHub PAT in step 2 and press enter.
- 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).
![img](https://user-images.githubusercontent.com/18723510/187771230-27c97889-d98a-48f7-af01-c1a9f8df6423.png)
```console
$ gh valet configure
✔ Which CI providers are you configuring?: Azure DevOps
Enter the following values (leave empty to omit):
✔ GitHub handle used to authenticate with the GitHub Container Registry: mona
✔ Personal access token to authenticate with the GitHub Container Registry: ***************
✔ Personal access token for GitHub: ***************
✔ Base url of the GitHub instance: https://github.com
✔ Personal access token for Azure DevOps: ***************
✔ Base url of the Azure DevOps instance: https://dev.azure.com
✔ Azure DevOps organization name: :organization
✔ Azure DevOps project name: :project
Environment variables successfully updated.
```
## Verify your environment
+1 -1
View File
@@ -172,7 +172,7 @@ Open the workflow that is generated and inspect the contents. Now the `DotnetCor
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.
To do this, add the following code at the top of the `transformers.rb` file.
```ruby
env "BUILDCONFIGURATION", "Debug"