How to Install GitLab CI on NetBSD

In this tutorial, we will cover the step-by-step process of installing GitLab CI on NetBSD.

Prerequisites

Before we begin, make sure you have the following prerequisites:

Step 1: Install GitLab CI

  1. SSH into your NetBSD server as root.

  2. Install GitLab CI by running the following command:

# pkg_add gitlab-runner

It will install GitLab CI Runner on your NetBSD server.

Step 2: Register GitLab CI Runner

  1. Navigate to your GitLab instance and create a new project.

  2. Click on the "Settings" cog in the top right corner and select "CI/CD".

  3. Under "Runners", click "Set up a specific Runner manually".

  4. Copy the URL and registration token.

  5. SSH back into your NetBSD server and run the following command to register your runner:

$ gitlab-runner register
  1. Follow the prompts and paste the URL and registration token when prompted.

  2. Choose a descriptive name for your runner and select the tags associated with it.

  3. Once registered, the runner will be ready to use.

Step 3: Configure GitLab CI Runner

  1. Navigate to your NetBSD server and open the GitLab Runner configuration file by running the following command:
$ vi /usr/pkg/etc/gitlab-runner/config.toml
  1. Edit the file to match the following example configuration:
concurrent = 1
check_interval = 0

[[runners]]
  name = "netbsd-runner"
  url = "https://gitlab.example.com/"
  token = "xxxxxxxxxxxxxxxxxxxxx"
  executor = "docker"
  environment = ["DOCKER_TLS_CERTDIR=", "DOCKER_CERT_PATH="]
  [runners.docker]
    tls_verify = false
    image = "docker:stable"
    privileged = true
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]
    extra_hosts = ["gitlab.example.com:192.168.1.1"]
    shm_size = 0

Note: Replace the name, url, and token values with your GitLab instance details.

  1. Save the file and exit.

Step 4: Test GitLab CI Runner

  1. Navigate to your GitLab project and create a simple .gitlab-ci.yml file with the following contents:
stages:
  - test
test:
  stage: test
  script:
    - echo "Hello, NetBSD!"
  1. Commit the file to the project's master branch.

  2. Navigate back to your NetBSD server and start the GitLab Runner by running the following command:

$ gitlab-runner start
  1. Verify the runner successfully picks up the job by checking the GitLab CI/CD pipeline.

  2. The pipeline should be successful and display the output Hello, NetBSD!.

Congratulations! You have successfully installed GitLab CI on NetBSD and used it to run a basic pipeline.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!