From 6008a7a272d5ef3fc1765d6bda3473329d933a0f Mon Sep 17 00:00:00 2001 From: j-dunham Date: Wed, 7 Sep 2022 11:26:38 -0400 Subject: [PATCH 1/3] Create 1-configure.md --- circle-ci/1-configure.md | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 circle-ci/1-configure.md diff --git a/circle-ci/1-configure.md b/circle-ci/1-configure.md new file mode 100644 index 0000000..ac1515c --- /dev/null +++ b/circle-ci/1-configure.md @@ -0,0 +1,48 @@ +# 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 CircleCI and GitHub. + +You will need to complete all of the setup instructions [here](./readme.md#configure-your-codespace) prior to performing this lab. + +## Configuring credentials + +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`. + - Click `Generate token`. + - Copy the generated PAT and save in a safe location. + +3. Create a CircleCI personal API token using CircleCI's [documentation](https://circleci.com/docs/managing-api-tokens#creating-a-personal-api-token) + +2. Run the `configure` CLI command: + ADD-DETAILS-HERE + + ADD-IMAGE-HERE + +## Verify your environment + +To verify our environment is configured correctly, we are going to run the `update` CLI command. The `update` CLI command will download the latest version of Valet to your codespace. + +1. In the codespace terminal run the following command: + + ```bash + gh valet update + ``` + +2. You should see a confirmation that you were logged into the GitHub Container Registry and Valet was updated to the latest version. + + ```bash + Login Succeeded + latest: Pulling from valet-customers/valet-cli + Digest: sha256:a7d00dee8a37e25da59daeed44b1543f476b00fa2c41c47f48deeaf34a215bbb + Status: Image is up to date for ghcr.io/valet-customers/valet-cli:latest + ghcr.io/valet-customers/valet-cli:latest + ``` + +### Next lab + +[Perform an audit of CircleCI](./2-audit.md) From 21d5161220a5eaa4f6fce017d593b366ad411833 Mon Sep 17 00:00:00 2001 From: j-dunham Date: Wed, 7 Sep 2022 12:59:55 -0400 Subject: [PATCH 2/3] Update 1-configure.md --- circle-ci/1-configure.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/circle-ci/1-configure.md b/circle-ci/1-configure.md index ac1515c..d95acc7 100644 --- a/circle-ci/1-configure.md +++ b/circle-ci/1-configure.md @@ -19,9 +19,20 @@ You will need to complete all of the setup instructions [here](./readme.md#confi 3. Create a CircleCI personal API token using CircleCI's [documentation](https://circleci.com/docs/managing-api-tokens#creating-a-personal-api-token) 2. Run the `configure` CLI command: - ADD-DETAILS-HERE + - Select the `TERMINAL` tab from within the codespace terminal window. + - Run the following command: `gh valet configure`. + - Using the down arrow key to highlight `CircleCI`, 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 CircleCI token prompt enter the CircleCI access token from step 2 and press enter. + - At the CircleCI base url prompt hit enter to accept the default value (`https://circleci.com`). + - 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`). + + ![configure-screenshot](https://user-images.githubusercontent.com/18723510/188935436-308fa6d3-6eb7-48b9-bbf0-20ab0cdae411.png) - ADD-IMAGE-HERE ## Verify your environment From e179dc7fc58f0b1154d34b7078961c34f2847886 Mon Sep 17 00:00:00 2001 From: j-dunham Date: Wed, 7 Sep 2022 19:53:17 -0400 Subject: [PATCH 3/3] Update circle-ci/1-configure.md Co-authored-by: Ethan Dennis --- circle-ci/1-configure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle-ci/1-configure.md b/circle-ci/1-configure.md index d95acc7..e2bf147 100644 --- a/circle-ci/1-configure.md +++ b/circle-ci/1-configure.md @@ -16,7 +16,7 @@ You will need to complete all of the setup instructions [here](./readme.md#confi - Click `Generate token`. - Copy the generated PAT and save in a safe location. -3. Create a CircleCI personal API token using CircleCI's [documentation](https://circleci.com/docs/managing-api-tokens#creating-a-personal-api-token) +3. Create a CircleCI personal API token using CircleCI's [documentation](https://circleci.com/docs/managing-api-tokens#creating-a-personal-api-token) and store the token in a safe location. 2. Run the `configure` CLI command: - Select the `TERMINAL` tab from within the codespace terminal window.