assistanz
Assistanz

How to Implement CI/CD Pipeline on FreeBSD

Implement CI/CD Pipeline on FreeBSD

 

I have come up with another article about How to Implement CI/CD Pipeline on FreeBSD. CI/CD pipeline is one of the best practices where software development and DevOps team can implement it. Let’s see how we can Implement CI/CD Pipeline on FreeBSD on one of the Unix flavors – the FreeBSD system.

For the remote repository, we will be using GitLab. Hence, the GitLab-runner tool has to be installed in the host and it is a pipeline tool used in GitLab. If you don’t have any repositories in gitlab, create one at gitlab .

Once you create a repository, go to Settings -> CI/CD -> Runners . Copy the runner register URL & the registration token and keep it safe to use later.

 

Implement CI/CD Pipeline on FreeBSD

Here are the steps to Implement CI/CD Pipeline on FreeBSD

 

Now it’s our turn to do some tricks in FreeBSD. Install the gitlab-runner package by using the below command and as usual before running this command make sure to update all packages if you want.

# pkg update

# pkg install –y gitlab-runner

 

 

This package will also create a user and group ‘gitlab-runner’ and this binary will run under this user. Once it is installed, run the below command to enable the runner service during system boot.

# sysrc gitlab_runner_enable=yes

 

Then, this runner has to be registered for the repository created in GitLab. To do so, execute the below command and proceed with the steps

# service gitlab_runner register

 

Steps to register the repository created in GitLab

 

  • Enter your GitLab instance URL as https://gitlab.com/
  • Provide the registration token that you obtained before.
  • Enter a description for your runner. Ex: freebsd-runner
  • Enter tags for your runner. Ex: deploy,build (Note: The runner will execute only with the associated tag.)
  • Enter any optional maintenance note for the runner.
  • Enter the executor as ‘shell’ (can execute shell scripts using this executor)

Next, you will see a message that the runner is registered successfully.

One last step is to start the gitlab-runner service now,

# service gitlab_runner start

 

Now you see that your runner is successfully configured and running in the GitLab interface as referred below and make sure that you disable the shared runner for your project.

Implement CI/CD Pipeline on FreeBSD

In order to list the available runners and configuration file location, run the below command

# service gitlab_runner list

 

Implement CI/CD Pipeline on FreeBSD

 

As I mentioned a user has been created during package installation. So, this runner service will run as the daemon user ‘gitlab-runner’. If you face any permission issue during any job execution, then update the few details in the rc.d service file (/usr/local/etc/rc.d/gitlab_runner) and restart the service.

  1. : ${gitlab_runner_user:=”root”}
  2. : ${gitlab_runner_group:=”wheel”}
  3. : ${gitlab_runner_dir:=”/gitlab_runner”}

Note: gitlab_runner_dir is the home directory where the repo will get cloned and initialized.

Once you upload the .gitlab-ci.yml file to the repo, the pipeline will start automatically and the defined jobs in YAML file will get executed. Navigate to CI/CD -> Pipelines Implementations to view the status.

Your feedback about the article “How to Implement CI/CD Pipeline on FreeBSD?” is much appreciated. Send your feedback to support@assistanz.com

DirectAdmin Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk
$ 99 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • NDA & SLA
  • SLA Review Meetings
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation
  •  

Platinum Support

24/7 Proactive Support
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Support

$ 30 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response Time
  • 4 Hours Resolution time for the Possible Issues
  • Security and Performance Optimization
  • React to Customers queries
  • Simple SignUp Process
  • Instant Account Activation
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support