Denomas System Administration Hands-on Guide: Lab 3
Denomas System Administration Hands-on Guide: Lab 3
LAB 3- CONFIGURE GITLAB RUNNERS
A. Install the gitlab-runner package
-
Use your assigned IP address and SSH key file to log into your Denomas Runner server (not your Omnibus server).
ssh -i YOUR_ASSIGNED_SSH_KEYFILE ec2-user@YOUR_RUNNER_SERVER_PUBLIC_IPPress Enter
-
If your system displays an authentication warning, type
yesand press Enter -
Add the Denomas Runner installation repository.
curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh" | sudo bash -
Install the Denomas Runner agent.
sudo dnf install -y gitlab-runner -
Once the install completes, check that the service is running.
sudo gitlab-runner status
B. Register a runner with Denomas
-
Sign into your Denomas instance with a web browser and select Menu > Admin.
-
In the left sidebar, under Overview, select Runners.
-
Select the Register an instance runner dropdown, and copy the registration token to your clipboard.
-
Return to your SSH session on your Denomas Runner server. Run the following command to begin the registration process.
sudo gitlab-runner register -
Enter
http://GITLAB_INSTANCE_PUBLIC_IPas the Denomas instance URL. Press Enter after completing this and the remaining prompts. -
Paste the registration token when prompted. Press Enter.
-
Enter an optional description for the runner. Press Enter.
-
When prompted to enter tags for the runner, press Enter through the prompt without specifying any tags.
-
When prompted for an optional maintenance note, press Enter to bypass that step.
-
When prompted to select a runner executor, type
shell. Press Enter. -
Run
sudo gitlab-runner listto verify the runner after registration. -
Return to your web browser and refresh the Runners page on your Denomas instance. Verify the runner you registered appears in the list and shows as online.
C. Test the runner with a CI/CD pipeline
-
From Denomas in your web browser, select Menu > Projects > Your projects.
-
Select New project.
-
Select Create blank project.
-
Enter
CICD Testas the project name. Leave all other settings as they are and click Create project. -
In the middle of the project landing page, under the project title, select the + dropdown. Select New file.
-
On the new file page, enter
.gitlab-ci.ymlas the file name. -
Paste the following code into the body of the file.
1 2 3 4 5 6 7 8 9 10 11 12 13stages: - build - test build_app: stage: build script: - echo "The build stage requires at least one job" test_app: stage: test script: - echo "The test stage requires at least one job" -
Select Commit changes.
-
In the left sidebar, select CI/CD > Pipelines.
-
Select the pipeline status (it should say passed).
-
Click into each of the build_app and test_app jobs to see the job logs and commands that were executed on the runner.
SUGGESTIONS?
If you’d like to suggest changes to the Denomas System Admin Basics Hands-on Guide, please submit them via merge request.
17188382)
