This lab bootstraps a Valet environment using GitHub Codespaces and enables you to create an Azure DevOps project against which to run the Valet CI/CD migration tool.
- Click the `Code` with button down arrow above repository on the repository's landing page.
- Click the `Codespaces` tab
- Click `Create codespaces on main` to create the codespace. If you are in another branch then the `main` branch, the codespace will button will have the current branch specified.
2. Verify the [extension](https://github.com/github/gh-valet) to the official GitHub CLI for Valet is installed and working.
- Run `gh valet version` in the Visual Studio Code terminal and verify the output looks like the below image. Note the valet version will be different than below as the latest version gets pulled down.
- If `gh valet version` did not produce a similar image with a version please follow these instructions [Troubleshoot GH Valet extension](#troubleshoot-gh-valet-extension)
- Name your token, select the organization where you want to use the token, and then set your token to automatically expire after a set number of days.
- Select the following scopes (Click `Show more scopes` if you don't see all of the below):
- 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 PAT somewhere safe and temporary.
2. Run the Azure DevOps setup script. This script will create an Azure DevOps project and ensure it is ready to be used in the following labs. This script should only need to be run once.
- Navigate to the terminal within your Codespace.
- Run `./azure_devops/bootstrap/setup --organization :organization --project :project --access-token :access-token` while replacing these values:
-`: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
- Once this script completes, you will see a new project in your Azure DevOps organization that is populated with some pipelines.