Merge branch 'main' into feature/circleci-labs

This commit is contained in:
Ethan Dennis
2022-09-19 12:35:55 -07:00
22 changed files with 343 additions and 516 deletions
+3 -1
View File
@@ -7,6 +7,7 @@ You will need to complete all of the setup instructions [here](./readme.md#confi
## Configuring credentials
1. Run the setup script in the codespace terminal to ensure the GitLab server is ready:
```bash
./gitlab/bootstrap/setup.sh
```
@@ -59,7 +60,8 @@ To verify your environment is configured correctly, run the `update` CLI command
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
+1 -1
View File
@@ -20,7 +20,7 @@ You will be performing an audit against your preconfigured GitLab server. Answer
- __valet__. In this example you will be auditing the `valet` group. In the future, you could add additional groups and subgroups to the audit command.
2. Where do you want to store the result?
- __./tmp/audit__. This can be any path within the working directory from which Valet commands are executed.
- __tmp/audit__. This can be any path within the working directory from which Valet commands are executed.
### Steps
+5 -5
View File
@@ -5,7 +5,7 @@ In this lab you will use the `forecast` command to forecast potential GitHub Act
## Prerequisites
1. Followed the steps [here](./readme.md#configure-your-codespace) to set up your GitHub Codespaces environment and start a GitLab server.
2. Completed the [configure lab](./1-configure-lab.md#configuring-credentials).
2. Completed the [configure lab](./1-configure.md#configuring-credentials).
## Perform a forecast
@@ -16,7 +16,7 @@ Answer the following questions before running the `forecast` command:
2. What is the date you want to start forecasting from?
- **2022-08-02**. This date is needed as it is prior to when the data was seeded in GitLab 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.
3. Where do you want to store the results?
- **./tmp/forecast_reports**
- **tmp/forecast**
### Steps
@@ -24,7 +24,7 @@ Answer the following questions before running the `forecast` command:
2. Run the following command from the root directory:
```bash
gh valet forecast gitlab --output-dir ./tmp/forecast_reports --namespace valet --start-date 2022-08-02
gh valet forecast gitlab --output-dir tmp/forecast --namespace valet --start-date 2022-08-02
```
3. The command will list all the files written to disk when the command succeeds.
@@ -33,7 +33,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`.
@@ -92,7 +92,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 --output-dir tmp/combined-forecast
gh valet forecast --source-file-path tmp/**/jobs/*.json --output-dir 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.
+7 -6
View File
@@ -5,7 +5,7 @@ In this lab you will use the `dry-run` command to convert a GitLab pipeline to i
## Prerequisites
1. Followed the steps [here](./readme.md#configure-your-codespace) to set up your Codespace environment and start a GitLab server.
2. Completed the [configure lab](./1-configure-lab.md#configuring-credentials).
2. Completed the [configure lab](./1-configure.md#configuring-credentials).
3. Completed the [audit lab](./2-audit.md).
## Perform a dry run
@@ -19,7 +19,7 @@ You will be performing a dry run against a pipeline in your preconfigured GitLab
- __Valet__
3. Where do you want to store the result?
- __./tmp/dry-run-lab__. This can be any path within the working directory from which Valet commands are executed.
- __tmp/dry-run__. This can be any path within the working directory from which Valet commands are executed.
### Steps
@@ -27,7 +27,7 @@ You will be performing a dry run against a pipeline in your preconfigured GitLab
2. Run the following command from the root directory:
```bash
gh valet dry-run gitlab --output-dir ./tmp/dry-run-lab --namespace valet --project basic-pipeline-example
gh valet dry-run gitlab --output-dir tmp/dry-run --namespace valet --project basic-pipeline-example
```
3. The command will list all the files written to disk when the command succeeds.
@@ -35,9 +35,9 @@ You will be performing a dry run against a pipeline in your preconfigured GitLab
![img](https://user-images.githubusercontent.com/18723510/184173635-aec28d1c-8c61-4dcf-a743-f86cbdc836c5.png)
4. View the converted workflow:
- Find `./tmp/dry-run/valet` in the file explorer pane in your codespace.
- Find `tmp/dry-run/valet` in the file explorer pane in your codespace.
- Click `basic-pipeline-example.yml` to open.
## Inspect the output files
The files generated from the `dry-run` command represent the equivalent Actions workflow for the given GitLab pipeline. The GitLab pipeline and converted workflow can be seen below:
@@ -98,7 +98,7 @@ deploy_b:
<details>
<summary><em>Converted workflow 👇</em></summary>
```yaml
name: valet/basic-pipeline-example
on:
@@ -196,6 +196,7 @@ jobs:
- run: echo "test stage complete. It will start at about the same time as deploy_a."
- run: sleep 400
```
</details>
Despite these two pipelines using different syntax they will function equivalently.
+1 -1
View File
@@ -10,7 +10,7 @@ In this lab you will build upon the `dry-run` command to override Valet's defaul
## Prerequisites
1. Followed the steps [here](./readme.md#configure-your-codespace) to set up your GitHub Codespaces environment and start you GitLab server.
2. Completed the [configure lab](./1-configure-lab.md#configuring-credentials).
2. Completed the [configure lab](./1-configure.md#configuring-credentials).
3. Completed the [dry-run lab](./4-dry-run.md).
## Perform a dry-run
+4 -4
View File
@@ -5,7 +5,7 @@ In this lab, you will use the `migrate` command to convert a GitLab pipeline and
## Prerequisites
1. Followed the steps [here](./readme.md#configure-your-codespace) to set up your GitHub Codespaces environment and start a GitLab server.
2. Completed the [configure lab](./1-configure-lab.md#configuring-credentials).
2. Completed the [configure lab](./1-configure.md#configuring-credentials).
3. Completed the [dry-run lab](./4-dry-run.md).
4. Completed the [custom transformers lab](./5-custom-transformers.md).
@@ -18,7 +18,7 @@ Answer the following questions before running a `migrate` command:
2. What is the namespace for that project?
- __Valet__
3. Where do you want to store the logs?
- __./tmp/migrate__
- __tmp/migrate__
4. What is the URL for the GitHub repository to add the workflow to?
- __this repository__. The URL should should follow the pattern <https://github.com/:owner/:repo> with `:owner` and `:repo` replaced with your values.
@@ -27,7 +27,7 @@ Answer the following questions before running a `migrate` command:
1. Run the following `migrate` command in the codespace terminal:
```bash
gh valet migrate gitlab --target-url https://github.com/:owner/:repo --output-dir ./tmp/migrate --namespace valet --project rails-example
gh valet migrate gitlab --target-url https://github.com/:owner/:repo --output-dir tmp/migrate --namespace valet --project rails-example
```
2. The command will write the URL to the pull request that was created when the command succeeds.
@@ -43,7 +43,7 @@ The first thing to notice about the pull request is that there is a list of manu
Next, you can inspect the "Files changed" in this pull request and see the converted workflow that is being added. Any additional changes or code reviews that were needed should be done in this pull request.
Finally, you can merge the pull request once your review has completed. You can then view the workflow running by selecting the "Actions" menu in the top navigation bar in GitHub.
![img](https://user-images.githubusercontent.com/18723510/184960870-590b1a28-422f-4350-9ec0-0423bf7ad445.png)
At this point, the migration has completed and you have successfully migrated a GitLab pipeline to Actions!
+30 -27
View File
@@ -12,48 +12,50 @@ These steps **must** be completed prior to starting other labs.
1. Start a new codespace
- Click the `Code` button on your 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` button on your 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 terminal:
- Run the following command in the codespace terminal:
```bash
gh valet version
```
```bash
gh valet version
```
- 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
```
- Verify the output is similar to below.
- If `gh valet version` did not produce similar output, please refer to the troubleshooting [guide](#troubleshoot-the-valet-cli).
```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, please refer to the troubleshooting [guide](#troubleshoot-the-valet-cli).
## Bootstrap a GitLab server
1. Execute the GitLab setup script that will start a container with GitLab running inside of it. The script should be executed when starting a new codespace or restarting an existing one.
- Run the following command from the codespace terminal:
```bash
./gitlab/bootstrap/setup.sh
```
- Run the following command from the codespace terminal:
- After some time, a pop-up box should appear with a link to the URL for your GitLab server.
- You can also access the URL by going to the `Ports` tab in your terminal. Right-click the URL listed under the `Local Address` and click the `Open in Browser` tab.
```bash
./gitlab/bootstrap/setup.sh
```
- After some time, a pop-up box should appear with a link to the URL for your GitLab server.
- You can also access the URL by going to the `Ports` tab in your terminal. Right-click the URL listed under the `Local Address` and click the `Open in Browser` tab.
2. Open the GitLab server in your browser and use the following credentials to authenticate:
- Username: `root`
- Password: `valet-labs!`
- Username: `root`
- Password: `valet-labs!`
- Once authenticated, you should see a GitLab server with a few predefined pipelines in the `valet` group.
3. Once authenticated, you should see a GitLab server with a few predefined pipelines in the `valet` group.
## Labs for GitLab
@@ -79,7 +81,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
```