
The -access-level parameter was added in GitLab Runner 12.0. The CI/CD pipeline can easily work with Docker, allowing a build agent to fire up a whole environment to perform testing, before a deploy process.Docker run -rm -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register \ -non-interactive \ -executor "docker" \ -docker-image alpine:latest \ -url "" \ -registration-token "PROJECT_REGISTRATION_TOKEN" \ -description "docker-runner" \ -maintenance-note "Free-form maintainer notes about this runner" \ -tag-list "docker,aws" \ -run-untagged = "true" \ -locked = "false" \ -access-level = "not_protected".You may need multiple deploy stages associated with different branches if you are using something like GitFlow to handler you progression through "Dev > Test > UAT > Prod" etc.You may prefer to have multiple deploy stages to deploy to all servers separately.This may include doing tests, builds and deploys to other servers.
Make sure the "gitlab-runner" OS user has the correct privileges to perform the actions, or sudo to perform them. Decide what your runner should do on a commit, and script accordingly. Things to consider include the following. What you do next depends on your requirements. The actions associated with the pipeline will now take place on every commit to the repository on the master branch. You will see a list of previous jobs and their statuses. If everything has worked, you should have a new file on the tmp]# cd tmp]# cat. Click the "Run Pipeline" button, and again on the subsequent screen. If it fails, look at the errors and fix them. On first commit of the file there will be a test of the pipeline. Navigate to the "CI/CD > Pipelines" page. Make sure you commit and push the new file to the GitLab repository. echo "Deploy to OBVM1" > "/tmp/deploy.txt" Notice this is "only" triggered by a commit on the "master" branch. Remember to adjust the environment name and IP address as required. Here's a simple example with a single deploy stage, that echos some text to a file on the server. This file can contain multiple stages associated with build, test and deploy operations. To use the runner you need a file called ".gitlab-ci.yml" in the root directory of your GitLab repository. #How to install gitlab runner how to#
Service gitlab-runner status Use the RunnerĪn 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. The URL and token are those displayed above.
Scroll down the page and check the "Set up a specific Runner manually" section. Click the "Expand" button next to the "Runners" section. Get the information needed to register the runner. Updates will be picked up in the normal way. The following actions are performed as the "root" user. There are multiple ways to install the GitLab runner software, but the one with the least maintenance is to use the GitLab runner repository. This could be a separate server that performs the actions to complete your deployment to a separate server, or the runner could run on the actual server that runs the code, such as an application server. You will sometimes hear the term "build agent", which is the server with the GitLab runner on it. You have GitLab repository, and want commits to that repository to trigger an action. If you are using an administrator user with SUDO privileges, simply add sudo to the front of each command. The installation and configuration actions are performed as the "root" user. You are using Oracle Linux, RHEL or CentOS.
This article describes how to install and configure a GitLab runner on Oracle Linux for use with CI/CD automation pipelines.
Home » Articles » Linux » Here Install and Configure a Gitlab Runner on Oracle Linux