From fe512cba165530391d684b5778bddd02d139a75d Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Tue, 9 Aug 2022 14:56:05 -0700 Subject: [PATCH 01/12] Add setup script --- jenkins/readme.md | 72 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/jenkins/readme.md b/jenkins/readme.md index 8349c4a..8483559 100644 --- a/jenkins/readme.md +++ b/jenkins/readme.md @@ -1 +1,71 @@ -# Coming Soon! +# Valet labs for Jenkins + +This lab bootstraps a Valet environment using GitHub Codespaces and enables you to spin up a Jenkins instance against which to run the Valet CI/CD migration tool. + +- [Use this Repo as a template](#repo-template) +- [Use Valet with a codespace](#use-valet-with-a-codespace) +- [Prerequisites](#prerequisites) +- [Bootstrap Jenkins](#bootstrap-jenkins) + +## Repo template + +1. Verify you are in your own Repository created from the landing page [Valet Labs](https://github.com/valet-customers/labs). + +## Prerequisites + +1. Create a GitHub personal access token. + - Navigate to your GitHub `Settings` - click your profile photo and click `Settings`. + - Go to `Developer Settings` + - Go to `Personal Access Tokens` -> `Legacy tokens (if present)` + - Click `Generate new token` -> `Legacy tokens (if present)`. If required, provide your password. + - Select at least these scopes: `read packages` and `workflow`. Optionally, provide a text in the **Note** field and change the expiration. + - Click `Generate token` + - Copy the PAT somewhere safe and temporary. + +## Use Valet with a codespace + +1. Start the 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. If you are in another branch then the `main` branch, the codespace will button will have the current branch specified. + - Wait a couple minutes, then verify that the codespace starts up. Once it is fully booted up, the termininal should be present. +2. Verify Valet CLI is installed and working. More information on the [GitHub Valet CLI extension](https://github.com/github/gh-valet) + - Verify Valet CLI 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) + +## Bootstrap Jenkins + + 1. Run the Jenkins setup script. This script will setup GitLab and ensure it is ready to use. In general, this script should be run first if you are starting a new codespace or restarting an existing one. + +- Navigate to the terminal within your Codespace. +- Run `source jenkins/bootstrap/setupjenkins.sh` to kick off the creation of your Jenkins instance. +- After a couple seconds, a pop-up box should appear with a link to the forwarded URL for your Jenkins instance. +- You can also access the fowarded URL by going to the `Ports` tab in your terminal. Right click on the URL listed under the `Local Address` and clicking the `Open in Browser` tab. +- Once you have navigated to the url, the following default credentials have been assigned: + + - username: `admin` + - password: `password` + +7. Click the `Sign in` button and you should now see your new Jenkins instance with a few pre-populataed pipelines. + +## Labs for Jenkins + +Perform the following labs to test-drive Valet + +- TBD + +## Troubleshoot GH Valet extension + +Manually Install the GitHub CLI Valet extension. More information on the [GitHub Valet CLI extension](https://github.com/github/gh-valet) + +- Verify you are in the Visual Studio Code terminal +- Run this command to install the GitHub Valet extension +- `gh extension install github/gh-valet` +- Verify the result of the install is: `✓ Installed extension github/gh-valet` +- If you get a similiar error to the following, click the link to authorize the token + ![linktolcickauth](https://user-images.githubusercontent.com/26442605/169588015-9414404f-82b6-4d0f-89d4-5f0e6941b029.png) + - Restart Codespace after clicking the link +- Verify Valet CLI is installed and working + +## Troubleshooting Jenkins From a2c31cad088f5791f8fcb31e77153bb74b7b48ba Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Tue, 9 Aug 2022 15:33:33 -0700 Subject: [PATCH 02/12] Update readme.md --- jenkins/readme.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jenkins/readme.md b/jenkins/readme.md index 8483559..9fcacaf 100644 --- a/jenkins/readme.md +++ b/jenkins/readme.md @@ -69,3 +69,9 @@ Manually Install the GitHub CLI Valet extension. More information on the [GitHub - Verify Valet CLI is installed and working ## Troubleshooting Jenkins +1. Navigate to the Docker tab on your left hand side. +2. Under the `Containers` tab you should see a Docker container `jenkins:valet` listed with a green play button ▶ + - If you see the `jenkins:valet` container, but it has a red stopped symbol next to it ▢, right click on the container and click on `start`, the container should begin running again. + - If the container does not start even after trying to manually start it, right click on the `jenkins:valet` container and click the `remove` button. Next continue by following all the #bootstrap-jenkins instructions again. + +Screen Shot 2022-08-09 at 3 06 46 PM From d799cba908593794cddc981e8ee830adccc70609 Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Wed, 10 Aug 2022 12:58:19 -0700 Subject: [PATCH 03/12] Update jenkins/readme.md Co-authored-by: Ethan Dennis --- jenkins/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/readme.md b/jenkins/readme.md index 9fcacaf..47d581b 100644 --- a/jenkins/readme.md +++ b/jenkins/readme.md @@ -47,7 +47,7 @@ This lab bootstraps a Valet environment using GitHub Codespaces and enables you - username: `admin` - password: `password` -7. Click the `Sign in` button and you should now see your new Jenkins instance with a few pre-populataed pipelines. +2. Click the `Sign in` button and you should now see your new Jenkins instance with a few pre-populataed pipelines. ## Labs for Jenkins From d992c16a0e7e3318beeb9a32d3f1987493a4c02e Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Wed, 10 Aug 2022 12:58:24 -0700 Subject: [PATCH 04/12] Update jenkins/readme.md Co-authored-by: Ethan Dennis --- jenkins/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/readme.md b/jenkins/readme.md index 47d581b..753c858 100644 --- a/jenkins/readme.md +++ b/jenkins/readme.md @@ -41,7 +41,7 @@ This lab bootstraps a Valet environment using GitHub Codespaces and enables you - Navigate to the terminal within your Codespace. - Run `source jenkins/bootstrap/setupjenkins.sh` to kick off the creation of your Jenkins instance. - After a couple seconds, a pop-up box should appear with a link to the forwarded URL for your Jenkins instance. -- You can also access the fowarded URL by going to the `Ports` tab in your terminal. Right click on the URL listed under the `Local Address` and clicking the `Open in Browser` tab. +- You can also access the forwarded URL by going to the `Ports` tab in your terminal. Right click on the URL listed under the `Local Address` and clicking the `Open in Browser` tab. - Once you have navigated to the url, the following default credentials have been assigned: - username: `admin` From 14cb27237387c5982b4146e8701eef175a56b222 Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Wed, 10 Aug 2022 12:58:33 -0700 Subject: [PATCH 05/12] Update jenkins/readme.md Co-authored-by: j-dunham --- jenkins/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/readme.md b/jenkins/readme.md index 753c858..39a9ad4 100644 --- a/jenkins/readme.md +++ b/jenkins/readme.md @@ -3,8 +3,8 @@ This lab bootstraps a Valet environment using GitHub Codespaces and enables you to spin up a Jenkins instance against which to run the Valet CI/CD migration tool. - [Use this Repo as a template](#repo-template) -- [Use Valet with a codespace](#use-valet-with-a-codespace) - [Prerequisites](#prerequisites) +- [Use Valet with a codespace](#use-valet-with-a-codespace) - [Bootstrap Jenkins](#bootstrap-jenkins) ## Repo template From e479692fc74a67958fc135001d286d7de29ece05 Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Wed, 10 Aug 2022 13:10:45 -0700 Subject: [PATCH 06/12] Update jenkins/readme.md Co-authored-by: j-dunham --- jenkins/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/readme.md b/jenkins/readme.md index 39a9ad4..a727bf2 100644 --- a/jenkins/readme.md +++ b/jenkins/readme.md @@ -66,7 +66,7 @@ Manually Install the GitHub CLI Valet extension. More information on the [GitHub - If you get a similiar error to the following, click the link to authorize the token ![linktolcickauth](https://user-images.githubusercontent.com/26442605/169588015-9414404f-82b6-4d0f-89d4-5f0e6941b029.png) - Restart Codespace after clicking the link -- Verify Valet CLI is installed and working +- Verify Valet CLI is installed and working by running `gh valet version` ## Troubleshooting Jenkins 1. Navigate to the Docker tab on your left hand side. From 699243fbad6cb66ba3b5327783a1ef6644fffa7f Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Wed, 10 Aug 2022 13:17:55 -0700 Subject: [PATCH 07/12] Update jenkins/readme.md Co-authored-by: j-dunham --- jenkins/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/readme.md b/jenkins/readme.md index a727bf2..ce0754d 100644 --- a/jenkins/readme.md +++ b/jenkins/readme.md @@ -36,7 +36,7 @@ This lab bootstraps a Valet environment using GitHub Codespaces and enables you ## Bootstrap Jenkins - 1. Run the Jenkins setup script. This script will setup GitLab and ensure it is ready to use. In general, this script should be run first if you are starting a new codespace or restarting an existing one. + 1. Run the Jenkins setup script. This script will setup Jenkins and ensure it is ready to use. In general, this script should be run first if you are starting a new codespace or restarting an existing one. - Navigate to the terminal within your Codespace. - Run `source jenkins/bootstrap/setupjenkins.sh` to kick off the creation of your Jenkins instance. From f7751b69739978239877c404b66304b45cccae00 Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Wed, 10 Aug 2022 13:32:19 -0700 Subject: [PATCH 08/12] Spacing --- jenkins/readme.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/jenkins/readme.md b/jenkins/readme.md index 9fcacaf..f2a2703 100644 --- a/jenkins/readme.md +++ b/jenkins/readme.md @@ -69,9 +69,10 @@ Manually Install the GitHub CLI Valet extension. More information on the [GitHub - Verify Valet CLI is installed and working ## Troubleshooting Jenkins -1. Navigate to the Docker tab on your left hand side. + +1. Navigate to the Docker tab on your left hand side. 2. Under the `Containers` tab you should see a Docker container `jenkins:valet` listed with a green play button ▶ - - If you see the `jenkins:valet` container, but it has a red stopped symbol next to it ▢, right click on the container and click on `start`, the container should begin running again. - - If the container does not start even after trying to manually start it, right click on the `jenkins:valet` container and click the `remove` button. Next continue by following all the #bootstrap-jenkins instructions again. - + - If you see the `jenkins:valet` container, but it has a red stopped symbol next to it ▢, right click on the container and click on `start`, the container should begin running again. + - If the container does not start even after trying to manually start it, right click on the `jenkins:valet` container and click the `remove` button. Next continue by following all the #bootstrap-jenkins instructions again. + Screen Shot 2022-08-09 at 3 06 46 PM From d50280be3c51366cbd44dc4701c33e1dc22cc683 Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Wed, 10 Aug 2022 13:52:10 -0700 Subject: [PATCH 09/12] Update readme.md --- jenkins/readme.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jenkins/readme.md b/jenkins/readme.md index 4288675..28b69f8 100644 --- a/jenkins/readme.md +++ b/jenkins/readme.md @@ -33,6 +33,8 @@ This lab bootstraps a Valet environment using GitHub Codespaces and enables you - Verify Valet CLI 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) + +Screen Shot 2022-08-10 at 1 45 20 PM ## Bootstrap Jenkins @@ -64,10 +66,11 @@ Manually Install the GitHub CLI Valet extension. More information on the [GitHub - `gh extension install github/gh-valet` - Verify the result of the install is: `✓ Installed extension github/gh-valet` - If you get a similiar error to the following, click the link to authorize the token - ![linktolcickauth](https://user-images.githubusercontent.com/26442605/169588015-9414404f-82b6-4d0f-89d4-5f0e6941b029.png) - Restart Codespace after clicking the link - Verify Valet CLI is installed and working by running `gh valet version` +![linktolcickauth](https://user-images.githubusercontent.com/26442605/169588015-9414404f-82b6-4d0f-89d4-5f0e6941b029.png) + ## Troubleshooting Jenkins 1. Navigate to the Docker tab on your left hand side. From 8625bb17d69e85615f8df9d88e91898533c2d002 Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Wed, 10 Aug 2022 13:53:03 -0700 Subject: [PATCH 10/12] Update jenkins/readme.md --- jenkins/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/readme.md b/jenkins/readme.md index 28b69f8..03f0206 100644 --- a/jenkins/readme.md +++ b/jenkins/readme.md @@ -61,7 +61,7 @@ Perform the following labs to test-drive Valet Manually Install the GitHub CLI Valet extension. More information on the [GitHub Valet CLI extension](https://github.com/github/gh-valet) -- Verify you are in the Visual Studio Code terminal +- Verify you are in the codespace terminal - Run this command to install the GitHub Valet extension - `gh extension install github/gh-valet` - Verify the result of the install is: `✓ Installed extension github/gh-valet` From 82c091ca8fac343976bf10a4a90a022be7e0770a Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Wed, 10 Aug 2022 14:17:00 -0700 Subject: [PATCH 11/12] Update jenkins/readme.md --- jenkins/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/readme.md b/jenkins/readme.md index 03f0206..5ad3ab3 100644 --- a/jenkins/readme.md +++ b/jenkins/readme.md @@ -41,7 +41,7 @@ This lab bootstraps a Valet environment using GitHub Codespaces and enables you 1. Run the Jenkins setup script. This script will setup Jenkins and ensure it is ready to use. In general, this script should be run first if you are starting a new codespace or restarting an existing one. - Navigate to the terminal within your Codespace. -- Run `source jenkins/bootstrap/setupjenkins.sh` to kick off the creation of your Jenkins instance. +- Run `source jenkins/bootstrap/setup.sh` to kick off the creation of your Jenkins instance. - After a couple seconds, a pop-up box should appear with a link to the forwarded URL for your Jenkins instance. - You can also access the forwarded URL by going to the `Ports` tab in your terminal. Right click on the URL listed under the `Local Address` and clicking the `Open in Browser` tab. - Once you have navigated to the url, the following default credentials have been assigned: From c300a656320b6fdfec6ed39a1722f92d5e2ec6b3 Mon Sep 17 00:00:00 2001 From: Begona Guereca Date: Thu, 11 Aug 2022 08:55:49 -0700 Subject: [PATCH 12/12] Update jenkins/readme.md --- jenkins/readme.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/jenkins/readme.md b/jenkins/readme.md index 5ad3ab3..eb9e71c 100644 --- a/jenkins/readme.md +++ b/jenkins/readme.md @@ -11,16 +11,6 @@ This lab bootstraps a Valet environment using GitHub Codespaces and enables you 1. Verify you are in your own Repository created from the landing page [Valet Labs](https://github.com/valet-customers/labs). -## Prerequisites - -1. Create a GitHub personal access token. - - Navigate to your GitHub `Settings` - click your profile photo and click `Settings`. - - Go to `Developer Settings` - - Go to `Personal Access Tokens` -> `Legacy tokens (if present)` - - Click `Generate new token` -> `Legacy tokens (if present)`. If required, provide your password. - - Select at least these scopes: `read packages` and `workflow`. Optionally, provide a text in the **Note** field and change the expiration. - - Click `Generate token` - - Copy the PAT somewhere safe and temporary. ## Use Valet with a codespace