Initial edits to ADO/gitlab/jenkins
This commit is contained in:
@@ -31,6 +31,7 @@ You will need to complete all of the setup instructions [here](./readme.md#confi
|
||||
- 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.
|
||||
- Name your token in the `Note` field.
|
||||
- Select the following scopes: `workflow` and `read:packages`.
|
||||
- Click `Generate token`.
|
||||
- Copy the generated PAT and save it in a safe location.
|
||||
@@ -39,7 +40,7 @@ You will need to complete all of the setup instructions [here](./readme.md#confi
|
||||
- Select the `TERMINAL` tab from within the codespace terminal window.
|
||||
- Run the following command: `gh valet configure`.
|
||||
- Use the down arrow key to highlight `GitLab CI`, press the spacebar to select, and then press enter to continue.
|
||||
- At the prompt, enter your GitHub username and press enter.
|
||||
- At the GitHub handle prompt, enter the GitHub handle used to generate the GitHub PAT in step 2 and press enter.
|
||||
- At the GitHub Container Registry prompt, enter the GitHub PAT generated in step 4 and press enter.
|
||||
- At the GitHub PAT prompt, enter the GitHub PAT generated in step 4 and press enter.
|
||||
- At the GitHub URL prompt, enter the GitHub instance URL or press enter to accept the default value (`https://github.com`).
|
||||
|
||||
+8
-2
@@ -211,7 +211,13 @@ include:
|
||||
- local: /config/test.gitlab-ci.yml
|
||||
```
|
||||
|
||||
The output of the `dry-run` command can be seen below:
|
||||
Run the following command from the root directory:
|
||||
|
||||
```bash
|
||||
gh valet dry-run gitlab --output-dir tmp/dry-run --namespace valet --project included-files-example
|
||||
```
|
||||
|
||||
The output of the command above can be seen below:
|
||||
|
||||
```yaml
|
||||
name: valet/included-files-example
|
||||
@@ -246,7 +252,7 @@ jobs:
|
||||
- run: echo "this is from a local file"
|
||||
```
|
||||
|
||||
It's important to note that Valet converted this into a single workflow without templates. This is because of fundamental differences in how GitLab templates and GitHub Actions templates (i.e. Reusable Workflows and Composite Actions) function in regards to job ordering. Unfortunately, elements of reusability will be sacrificed in order for the converted pipelines to function the same. It is likely that the output of Valet could be refactored to use [reusable workflow](https://docs.github.com/en/actions/using-workflows/reusing-workflows) at a later date.
|
||||
It's important to note that Valet converted this into a single workflow without templates. This is because of fundamental differences in how GitLab templates and GitHub Actions templates (i.e. Reusable Workflows and Composite Actions) function in regards to job ordering. Unfortunately, elements of reusability will be sacrificed in order for the converted pipelines to function the same. It is likely that the output of Valet could be refactored to use [reusable workflows](https://docs.github.com/en/actions/using-workflows/reusing-workflows) at a later date.
|
||||
|
||||
As an added challenge, try constructing and running the `dry-run` command yourself. Hint, you should only have to change the project name.
|
||||
|
||||
|
||||
@@ -9,7 +9,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.
|
||||
1. Followed the steps [here](./readme.md#configure-your-codespace) to set up your GitHub Codespaces environment and start your GitLab server.
|
||||
2. Completed the [configure lab](./1-configure.md#configuring-credentials).
|
||||
3. Completed the [dry-run lab](./4-dry-run.md).
|
||||
|
||||
@@ -63,7 +63,7 @@ The converted workflow above contains an `artifacts.terraform` step that was not
|
||||
- __artifacts.terraform__
|
||||
|
||||
2. What is the desired Actions syntax to use instead?
|
||||
- After some research, you have determined that the following bash script will provide similar functionality:
|
||||
- After some research, you have determined that the following GitHub Action will provide similar functionality:
|
||||
|
||||
```yaml
|
||||
- uses: actions/upload-artifact@v3
|
||||
@@ -82,7 +82,7 @@ Next, you will define a `transform` method for the `artifacts.terraform` identif
|
||||
```ruby
|
||||
transform "artifacts.terraform" do |item|
|
||||
{
|
||||
uses: "actions/upload-artifact@v2",
|
||||
uses: "actions/upload-artifact@v3",
|
||||
with: {
|
||||
path: item
|
||||
}
|
||||
|
||||
+2
-3
@@ -7,7 +7,6 @@ In this lab, you will use the `migrate` command to convert a GitLab pipeline and
|
||||
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.md#configuring-credentials).
|
||||
3. Completed the [dry-run lab](./4-dry-run.md).
|
||||
4. Completed the [custom transformers lab](./5-custom-transformers.md).
|
||||
|
||||
## Performing a migration
|
||||
|
||||
@@ -20,14 +19,14 @@ Answer the following questions before running a `migrate` command:
|
||||
3. Where do you want to store the logs?
|
||||
- __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.
|
||||
- __this repository__. The URL should should follow the pattern <https://github.com/:owner/:repo> with `:owner` and `:repo` replaced with your values. The command below uses `git remote get-url` to automatically populate these values.
|
||||
|
||||
### Steps
|
||||
|
||||
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 $(git remote get-url origin) --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.
|
||||
|
||||
Reference in New Issue
Block a user