2.6 KiB
2.6 KiB
Configure Valet To Work With GitLab Using The configure Command
In this lab, you will use Valet's configure command to set up the required secrets to communicate with the GitLab and GitHub instances. The configure command can be used for all of the supported providers, but in this lab we will be focusing on GitLab.
Prerequisites
- Followed steps to set up your codespace environment.
Configuring Valet
- Run the setup script in the codespace terminal
source ./gitlab/bootstrap/setup.shand record the username and password for the next step. - Login to the GitLab instance to generate a personal access token:
- Click the
PORTStab in the codespace terminal window. - In the
PORTStab find the row for port 80. - Hover over the address under the
Local Addresscolumn, and click the globe to open in browser - Login to the GitLab server and following instructions to generate a token that has
read_apiscope. - Record token for use in later steps.
- Click the
- Create a GitHub personal access token.
- Navigate to your GitHub
Settings- click your profile photo and then clickSettings. - 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 packagesandworkflow. Optionally, provide a text in the Note field and change the expiration. - Click
Generate token - Copy the token somewhere safe and temporary.
- Navigate to your GitHub
- In the codespace terminal run
gh valet configure. - Using the down arrow key to highlight
GitLab CI, press the spacebar to select, then hit enter to accept. - Enter the previously generated GitHub access token from step 3.
- Enter the GitHub instance url or hit enter to accept the default, if you are using github.com
- Enter the GitLab access token from step 2 and press enter.
- Enter
http://localhostfor the GitLab instance url - If all went well you should see a similar output in your terminal ADD_IMAGE_HERE
Verify Valet Works
To verify Valet works we are going to run a dry-run command. We will go further into details about the dry-run command in a later lab, but for now we just want to confirm that Valet runs with no errors.
Next Lab
Dry run the migration of an GitLab pipeline to GitHub Actions ADD_LINK_HERE