Copy edit text
This commit is contained in:
+26
-26
@@ -1,4 +1,4 @@
|
||||
# Configure credentials for Valet
|
||||
a# Configure credentials for Valet
|
||||
|
||||
In this lab, you will use the `configure` CLI command to set the required credentials and information for Valet to use when working with Travis CI and GitHub.
|
||||
|
||||
@@ -6,37 +6,36 @@ You will need to complete all of the setup instructions [here](./readme.md#confi
|
||||
|
||||
## Configuring credentials
|
||||
|
||||
1. Create a GitHub Personal Access Token (PAT):
|
||||
1. Create a GitHub personal access token (PAT):
|
||||
- Open github.com in a new browser tab.
|
||||
- Click your profile photo in the top right of the UI and click `Settings`.
|
||||
- Click on `Developer Settings` in the left hand panel.
|
||||
- Click `Personal Access Tokens` and then `Legacy tokens` (if present).
|
||||
- Click `Generate new token` and then `Legacy tokens`. You may be required to authenticate with GitHub during this step.
|
||||
- Select the following scopes: `read:packages` and `workflow`.
|
||||
- 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 in a safe location.
|
||||
- Copy the generated PAT and save it in a safe location.
|
||||
|
||||
3. Create a Travis CI PAT:
|
||||
- Open Travis CI in a new browser tab.
|
||||
3. Create a Travis CI personal access token (PAT):
|
||||
- Open app.travis-ci.com in a new browser tab.
|
||||
- Click on your profile icon in the top right hand corner to reveal a dropdown menu.
|
||||
- Click on the 'Settings' tab.
|
||||
- Click on the 'COPY TOKEN' button under "API authentication header" and save in a safe location.
|
||||
- Click on the `Settings` tab.
|
||||
- Click on the `COPY TOKEN` button under "API authentication header" and save it in a safe location.
|
||||
|
||||
2. 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 `Travis CI`, press the spacebar to select, and then hit enter to continue.
|
||||
- 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 value (`https://github.com`).
|
||||
- At the Travis CI token prompt enter the Travis CI access token from step 2 and press enter.
|
||||
- At the Travis CI base url prompt hit enter to accept the default value (`https://travis-ci.com`).
|
||||
- At the Travis CI organization name enter `valet-labs`.
|
||||
- At the access token to fetch source code in GitHub prompt enter the GitHub PAT generated in step 1 and press enter.
|
||||
- At the GitHub instance url containing source code prompt press enter to accept the default value (`https://github.com`).
|
||||
- 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 Travis CI token prompt, enter the Travis CI access token from step 2 and press enter.
|
||||
- At the Travis CI base url prompt, hit enter to accept the default value (`https://travis-ci.com`).
|
||||
- At the Travis CI organization name, enter `valet-labs`.
|
||||
- At the access token to fetch source code in GitHub prompt, enter the GitHub PAT generated in step 1 and press enter.
|
||||
- At the GitHub instance url containing source code prompt, press enter to accept the default value (`https://github.com`).
|
||||
|
||||

|
||||

|
||||
|
||||
## Verify your environment
|
||||
|
||||
@@ -50,7 +49,8 @@ To verify our environment is configured correctly, we are going to run the `upda
|
||||
|
||||
2. You should see a confirmation that you were logged into the GitHub Container Registry and Valet was updated to the latest version.
|
||||
|
||||
```bash
|
||||
```console
|
||||
$ gh valet update
|
||||
Login Succeeded
|
||||
latest: Pulling from valet-customers/valet-cli
|
||||
Digest: sha256:a7d00dee8a37e25da59daeed44b1543f476b00fa2c41c47f48deeaf34a215bbb
|
||||
@@ -60,4 +60,4 @@ To verify our environment is configured correctly, we are going to run the `upda
|
||||
|
||||
### Next lab
|
||||
|
||||
[Perform an audit of Travis CI](./2-audit.md)
|
||||
[Perform an audit of a Travis CI organization](./2-audit.md)
|
||||
|
||||
@@ -14,7 +14,7 @@ Answer the following questions before running the `forecast` command:
|
||||
1. What is the date you want to start forecasting from?
|
||||
- **2022-09-02**. This date is needed as it is prior to when the bulk of builds were trigger in the demo Travis CI organization for these labs. This value defaults to the date one week ago, however, you should use a start date that will show a representative view of typical usage.
|
||||
2. Where do you want to store the results?
|
||||
- **./tmp/forecast_reports**
|
||||
- **tmp/forecast**
|
||||
|
||||
### Steps
|
||||
|
||||
@@ -22,7 +22,7 @@ Answer the following questions before running the `forecast` command:
|
||||
2. Run the following command from the root directory:
|
||||
|
||||
```bash
|
||||
gh valet forecast travis-ci --output-dir ./tmp/forecast_reports --start-date 2022-09-02
|
||||
gh valet forecast travis-ci --output-dir tmp/forecast --start-date 2022-09-02
|
||||
```
|
||||
|
||||
3. The command will list all the files written to disk when the command succeeds.
|
||||
@@ -31,7 +31,7 @@ Answer the following questions before running the `forecast` command:
|
||||
|
||||
## Review the forecast report
|
||||
|
||||
The forecast report, logs, and completed job data will be located within the `tmp/forecast_reports` folder.
|
||||
The forecast report, logs, and completed job data will be located within the `tmp/forecast` folder.
|
||||
|
||||
1. Find the `forecast_report.md` file in the file explorer.
|
||||
2. Right-click the `forecast_report.md` file and select `Open Preview`.
|
||||
@@ -90,7 +90,7 @@ You can use the `--source-file-path` CLI option to combine data from multiple re
|
||||
Run the following command from within the codespace terminal:
|
||||
|
||||
```bash
|
||||
gh valet forecast --source-file-path tmp/**/jobs/*.json -o tmp/combined-forecast
|
||||
gh valet forecast --source-file-path tmp/**/jobs/*.json -o tmp/forecast-combined
|
||||
```
|
||||
|
||||
You can now inspect the output of the command to see a forecast report using all of the files matching the `tmp/**/jobs/*.json` pattern.
|
||||
|
||||
+3
-3
@@ -16,7 +16,7 @@ You will be performing a dry-run against a TravisCI project. Answer the followin
|
||||
- __travisci-ruby-example__. This is one of the sample projects avaiable in the TravisCI labs-data organization.
|
||||
|
||||
2. Where do you want to store the result?
|
||||
- __./tmp/dry-run-lab__. This can be any path within the working directory that Valet commands are executed from.
|
||||
- __tmp/dry-run__. This can be any path within the working directory that Valet commands are executed from.
|
||||
|
||||
### Steps
|
||||
|
||||
@@ -24,7 +24,7 @@ You will be performing a dry-run against a TravisCI project. Answer the followin
|
||||
2. Run the following command from the root directory:
|
||||
|
||||
```bash
|
||||
gh valet dry-run travis-ci --travis-ci-repository "travisci-ruby-example" --output-dir tmp/travis/dry-run-lab
|
||||
gh valet dry-run travis-ci --travis-ci-repository "travisci-ruby-example" --output-dir tmp/dry-run
|
||||
```
|
||||
|
||||
3. The command will list all the files written to disk when the command succeeds.
|
||||
@@ -32,7 +32,7 @@ You will be performing a dry-run against a TravisCI project. Answer the followin
|
||||

|
||||
|
||||
4. View the converted workflow:
|
||||
- Find `./tmp/travis/dry-run-lab` in the file explorer pane in your codespace.
|
||||
- Find `tmp/dry-run` in the file explorer pane in your codespace.
|
||||
- Click `travisci-ruby-example.yml` to open.
|
||||
|
||||
## Inspect the output files
|
||||
|
||||
@@ -18,7 +18,7 @@ In this lab you will build upon the `dry-run` command to override Valet's defaul
|
||||
You will be performing a `dry-run` command to inspect the workflow that is converted by default. Run the following command within the codespace terminal:
|
||||
|
||||
```bash
|
||||
gh valet dry-run travis-ci --travis-ci-repository "travisci-deploy-example" --output-dir tmp/travis/dry-run
|
||||
gh valet dry-run travis-ci --travis-ci-repository "travisci-deploy-example" --output-dir tmp/dry-run
|
||||
```
|
||||
|
||||
The converted workflow that is generated by the above command can be seen below:
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ Answer the following questions before running a `migrate` command:
|
||||
1. Run the following `migrate` command in the codespace terminal. Ensure the values in `--target-url` for `:owner` and `:repo` are replaced with your values:
|
||||
|
||||
```bash
|
||||
gh valet migrate travis-ci --target-url https://github.com/:owner/:repo --output-dir ./tmp/migrate --travis-ci-repository "travisci-deploy-example"
|
||||
gh valet migrate travis-ci --target-url https://github.com/:owner/:repo --output-dir tmp/migrate --travis-ci-repository "travisci-deploy-example"
|
||||
```
|
||||
|
||||
2. The command will write the URL to the pull request that was created when the command succeeds.
|
||||
|
||||
+18
-16
@@ -12,28 +12,29 @@ These steps **must** be completed prior to starting other labs.
|
||||
|
||||
1. Start a new Codespace.
|
||||
|
||||
- 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.
|
||||
- After the Codespace has initialized there will be a terminal present.
|
||||
- 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.
|
||||
- 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's terminal:
|
||||
|
||||
```bash
|
||||
gh valet version
|
||||
```
|
||||
```bash
|
||||
gh valet version
|
||||
```
|
||||
|
||||
- Verify the output is similar to below. The version information may differ than what is shown below, it is expected that the `valet-cli` version is unknown. This will be corrected in the [configure credentials for Valet](1-configure.md) lab.
|
||||
- Verify the output is similar to below.
|
||||
|
||||
```bash
|
||||
gh version 2.14.3 (2022-07-26)
|
||||
gh valet github/gh-valet v0.1.12
|
||||
valet-cli unknown
|
||||
```
|
||||
```console
|
||||
$ gh valet version
|
||||
gh version 2.14.3 (2022-07-26)
|
||||
gh valet github/gh-valet v0.1.12
|
||||
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 then please follow the troubleshooting [guide](#troubleshoot-the-valet-cli).
|
||||
|
||||
## Labs for Travis CI
|
||||
|
||||
@@ -59,7 +60,8 @@ The CLI extension for Valet can be manually installed by following these steps:
|
||||
|
||||
- Verify the result of the install contains:
|
||||
|
||||
```bash
|
||||
```console
|
||||
$ gh extension install github/gh-valet
|
||||
✓ Installed extension github/gh-valet
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user