Commit 0782f73c authored by Ian Ernst's avatar Ian Ernst Committed by Dan Plumbley
Browse files

Advanced CICD Lab 1 Fix

parent 914db84b
Loading
Loading
Loading
Loading
+6 −22
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ To start, let's create a new project in the lab environment:

1. Select **Create project runner**.

1. Select **Run untagged jobs**, leave all other settings as default, and select **Create runner**.
1. Add `node` as a tag inside of the tag box, ensure that **Run untagged jobs** remains unchecked, leave all other settings as default, and select **Create runner**.

1. Ensure that Linux is selected as your operating system.

@@ -168,6 +168,8 @@ When this runner is created, it will have a `config.toml` file that defines the
          network_mtu = 0
      ```

1. Double check that the `token:` value does not have `[MASKED]`. If it does, Your GITLAB_RUNNER_TOKEN is set to masked and not visible.

1. Make a note of this output, as you will need it in the next task.

## Task E. Editing your runner configuration
@@ -263,7 +265,7 @@ To make these changes, we will push a `config.toml` file to the runner.
          - ssh-keyscan -t rsa,ed25519 $ip >> ~/.ssh/known_hosts
        script:
          - ssh root@$ip 'gitlab-runner unregister --all-runners'
          - ssh root@$ip 'gitlab-runner register --non-interactive --url https://ilt.gitlabtraining.cloud --executor "docker" --docker-image alpine:latest  --token your-runner-token'
          - ssh root@$ip 'gitlab-runner register --non-interactive --url https://ilt.gitlabtraining.cloud --executor "docker" --docker-image alpine:latest  --token '"$GITLAB_RUNNER_TOKEN"'
          - scp config.toml root@$ip:/etc/gitlab-runner/config.toml
          - ssh root@$ip 'gitlab-runner restart'
          - ssh root@$ip 'cat /etc/gitlab-runner/config.toml'
@@ -279,12 +281,6 @@ To test the runner, let's create a basic Docker in Docker configuration to use f

1. Navigate to your `CICD Runner` project.

1. Start by disabling instance level runners to ensure the jobs run on your project runner. To do this, navigate to **Settings > CI/CD**.

1. Click the arrow next to **Runners** to expand the Runners section.

1. Toggle `Turn on instance runners for this project` **off**.

1. Navigate back to your code repository.

1. Select **+ > New file**.
@@ -327,26 +323,14 @@ To test the runner, let's create a basic Docker in Docker configuration to use f
          - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
          - docker build -t $IMAGE .
          - docker push $IMAGE
        tags:
          - node
      ```

1. Select **Commit changes**.

When your pipeline runs, you should see your job succeed using your new Docker runner!

## Task G. Disabling the runner

For future labs, it is best to use the instance runners to ensure consistency in your results. To allow for this, disable your custom runner using the following steps:

1. Navigate to your project.

1. Select **Settings > CI/CD**.

1. Click the arrow next to **Runners** to expand the Runners section.

1. Toggle `Turn on instance runners for this project` to **on**.

1. Pause your assigned project runner by selecting the pause button.

## Lab Guide Complete

You have completed this lab exercise. You can view the other [lab guides for this course](/handbook/customer-success/professional-services-engineering/education-services/ilt-labs/advgitlabcicdhandson).