8i | 9i | 10g | 11g | 12c | 13c | 18c | 19c | Misc | PL/SQL | SQL | RAC | WebLogic | Linux

Home » Articles » Linux » Here

Install and Configure a Gitlab Runner on Oracle Linux

This article describes how to install and configure a GitLab runner on Oracle Linux for use with CI/CD automation pipelines.

Assumptions

This article assumes the following.

Install the Runner

There are multiple ways to install the GitLab runner software, but the one with the least maintenance is to use the GitLab runner repository. The following actions are performed as the "root" user.

curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh | sudo bash
yum install -y gitlab-runner

Updates will be picked up in the normal way.

# Just this package.
yum update -y gitlab-runner

# All packages, including this.
yum update -y

Register the Runner

Get the information needed to register the runner.

Register the runner. The URL and token are those displayed above. The description is just text. I've given it the machine name.

gitlab-runner register -n \
  --url https://gitlab.com/ \
  --registration-token {YourToken} \
  --executor shell \
  --description "obvm1"

Check the runner is active.

service gitlab-runner status

Use the Runner

An explanation of how to use the running is beyond the scope of this post, but here is a simple example to test the runner is working as expected.

To use the runner you need a file called ".gitlab-ci.yml" in the root directory of your GitLab repository. This file can contain multiple stages associated with build, test and deploy operations. Here's a simple example with a single deploy stage, that echos some text to a file on the server. Remember to adjust the environment name and IP address as required. Notice this is "only" triggered by a commit on the "master" branch.

stages:
  - deploy

deploy_to_obvm1: 
  stage: deploy
  script:
  - echo "Deploy to OBVM1" >> "/tmp/deploy.txt"
  environment:
    name: obvm1
    url: 123.123.123.123
  only:
  - master

Make sure you commit and push the new file to the GitLab repository. Then do the following.

The actions associated with the pipeline will now take place on every commit to the repository on the master branch.

What Next

What you do next depends on your requirements. Things to consider include the following.

For more information see:

Hope this helps. Regards Tim...

Back to the Top.