{"id":16836553,"url":"https://github.com/orangecms/freebsd-jenkins-tutorial","last_synced_at":"2026-03-18T22:32:04.215Z","repository":{"id":33534649,"uuid":"37180758","full_name":"orangecms/freebsd-jenkins-tutorial","owner":"orangecms","description":"a tutorial for setting up a Jenkins CI server on FreeBSD","archived":false,"fork":false,"pushed_at":"2015-06-10T18:45:24.000Z","size":684,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-24T10:25:23.579Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ofek/coincurve","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orangecms.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-10T06:56:10.000Z","updated_at":"2020-06-11T16:37:30.000Z","dependencies_parsed_at":"2022-07-13T13:20:31.623Z","dependency_job_id":null,"html_url":"https://github.com/orangecms/freebsd-jenkins-tutorial","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orangecms%2Ffreebsd-jenkins-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orangecms%2Ffreebsd-jenkins-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orangecms%2Ffreebsd-jenkins-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orangecms%2Ffreebsd-jenkins-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orangecms","download_url":"https://codeload.github.com/orangecms/freebsd-jenkins-tutorial/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244147343,"owners_count":20405942,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T12:13:47.136Z","updated_at":"2026-01-28T18:04:03.850Z","avatar_url":"https://github.com/orangecms.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# About\nThis tutorial explains how to install the [Jenkins CI server](http://jenkins-ci.org/) on FreeBSD together with PHP, Node.js, git, and a couple of task runners.\n\n## Introduction\nIf you develop applications with PHP (the PHP Hypertext Preprocessor), you may already have read or heard that many projects nowadays choose agile methods for quick progress. This includes test-driven development (TDD), behavior-driven development (BDD), collaboriational platforms for version control like GitHub, and finally, [Continuous Integration (CI)](http://en.wikipedia.org/wiki/Continuous_integration) comes into play. CI is basically automating what a lead developer would do in a hierarchically structured company: Analyze code that the involved team members of a project have written, run tests, make sure things work, and on success, merge the changes, new features or fixes into the main repository, or notify the committer otherwise.\n\n# Tutorial: Install a Jenkins CI server on FreeBSD\n## Prerequisites and preparation\nIf you set up a [FreeBSD droplet on DigitalOcean](https://www.digitalocean.com/company/blog/presenting-freebsd-how-we-made-it-happen/), simply [connect to your droplet via SSH](https://www.digitalocean.com/community/tutorials/how-to-get-started-with-freebsd-10-1) and run `sudo su` once first since almost all the following commands will require root access. Otherwise, just connect to your target machine via SSH or do whatever you prefer to have a shell and the necessary access rights.\n\n### Update first\nBefore doing anything else, you should update the base system:\n```\n    pkg update \u0026\u0026 pkg upgrade\n```\n\n### Optional: Install an easy-to-use text editor\nThe editor `nano` can be installed to edit files mentioned below. This is optional however and you are free to use any other editor if you want.\n```\n    pkg install nano\n```\n\n## Installation\n### Basic tools\nTo build Jenkins later, we will need the current snapshot of FreeBSD's ports tree which is versioned through SVN (subversion).\n\nInstall subversion first:\n```\n    pkg install subversion\n```\nAnd then fetch the current tree:\n```\n    portsnap fetch extract\n```\nThis will take quite some minutes, so you can read on in the meantime.\n\n### Build and install Jenkins\nThe following steps are what you can also find on the [Jenkins website](https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+inside+a+FreeNAS+jail) except for the JDK which we will install from the binary repository.\n\nJenkins is written in Java. Thus, first install the Java Development Kit (JDK):\n```\n    pkg install openjdk8\n```\nThen install Jenkins from the port:\n```\n    cd /usr/ports/devel/jenkins\n    make install clean BATCH=yes\n```\n\n### Task runners, Node.js, OpenSSL, PHP and modules\nThe key tools for automation are task runners. Many of them exist in many languages, so let's focus on a few of them.\n\nPopular Java Task runners are Gradle and Ant:\n```\n    pkg install gradle apache-ant\n```\n\nJavaScript developers often use Grunt to build their projects, so install Node.js and npm, the Node.js package manager:\n```\n    pkg install node npm\n```\nGrunt itself is installed through npm. The package name is, however, grunt-cli, because it has been [split up to support multiple version](http://gruntjs.com/getting-started):\n```\n    npm install -g grunt-cli\n```\n\nTo run tests for your PHP project, install it as well as the modules which you also have on your development machine:\n```\n    pkg install php56-fileinfo php56-iconv php56 php56-json php56-mbstring php56-session php56-tokenizer php56-xmlwriter php56-xsl\n```\n\nFor package management in PHP, install `composer`:\n```\n    pkg install php-composer\n```\n\nTo support composer packages that are hosted on GitHub, also install `git` and `openssl`:\n```\n    pkg install openssl git\n```\n\n## Configuration\n\n### PHP\nPHP will need some configuration to work with OpenSSL. Create a symlink for your `php.ini`:\n```\n    cd /usr/local/etc/\n    ln -s php.ini-development php.ini\n```\nOpenSSL stores certificates in these locations:\n```\n    php -r \"print_r(openssl_get_cert_locations());\"\n```\nAdd the local certificate to php.ini using nano or your preferred editor:\n```\n    nano php.ini\n```\nFar at the bottom you will find this line (you can scroll down in nano with PgDown):\n```\n    ;openssl.cafile=\n```\nAdd this line below (in nano you can just use press return for a new line and type):\n```\n    openssl.cafile=/usr/local/etc/ssl/cert.pem\n```\nYou should also set your timezone here. The corresponding line is (in nano, search with Ctrl+w, enter `timezone` and press return):\n```\n    ;date.timezone =\n```\nThe value should be a string like the following (assuming you're in Central Europe, just enter the value like you did with openssl.cafile):\n```\n    date.timezone = Europe/Berlin\n```\nThen save the changes (Ctrl+X, then `y` to confirm and enter in nano).\n\n### Jenkins\nTo have Jenkins started at system boot, add it to `rc.conf`:\n```\n    echo 'jenkins_enable=\"YES\"' \u003e\u003e /etc/rc.conf\n```\nTo start the service now:\n```\n    service jenkins start\n```\n\nYou can then access Jenkins' web interface on `http://your-droplet:8180/jenkins/` and begin configuring it. The first start will take a few minutes.\n\n![Jenkins first start](img/jenkins-first-start.png?raw=true)\n\nYou will then be presented with the overview page.\n\n![Jenkins overview](img/jenkins-overview.png?raw=true)\n\nClick on \"Manage Jenkins\" and look a bit further down to see hints on configuration.\n\n![Jenkins management](img/jenkins-manage.png?raw=true)\n\n**Attention**: Set up access controls first since this instance is now exposed and anyone may try to access it.\n\n![Jenkins security setup](img/jenkins-security.png?raw=true)\n\nA quick way to set it up is the following:\n- Click the \"Setup Security\" button (or \"Configure Global Security\")\n- Check \"Enable security\"\n- Set \"Security Realm\" to \"Jenkins' own user database\"\n- Set \"Authorization\" to \"Logged-in users can do anything\"\n- Click \"Save\"\n- Register an account (link in the upper right)\n- Go back to the security settings\n- Uncheck \"Allow users to sign up\"\n\nNow if you login again with your newly created user, you will be presented the overview page again.\n\n![Jenkins overview](img/jenkins-overview-2.png?raw=true)\n\nBefore installing the plugins you need to build your project, update all the plugins that are currently installed.\n\n![Jenkins plugins](img/jenkins-plugins.png)\n\nThis will take some time again because the new versions have to be downloaded first and then applied.\n\n![Jenkins plugins upgrade](img/jenkins-plugins-upgrade.png)\n\nFinally, restart Jenkins:\n```\n    service jenkins restart\n```\n\nTo enable support for the various tools we have just installed, install the respective plugins through the web interface as well. Navigate to the \"Manage Plugins\" page again, click on the \"Available\" tab and use the search field to find them quickly, since Jenkins offers a huge list of plugins. You will at least need:\n- php\n- Git plugin\nIf you there is anything else you find interesting, feel free to install it as well.\n\n![Jenkins plugins installation](img/jenkins-plugins-installation.png)\n\n## Upgrading\nIf updates are available, Jenkins will notify you.\n\n![Jenkins updates available](img/jenkins-updates-available.png)\n\nTo upgrade Jenkins itself, do so from the ports tree. Connect to your FreeBSD machine, get root access and update your ports tree:\n```\n    portsnap fetch update\n```\nThen build and reinstall Jenkins:\n```\n    cd /usr/ports/devel/jenkins\n    make reinstall clean BATCH=yes\n```\nAnd restart the service:\n```\n    service jenkins restart\n```\n\n## Finish\nThat's it, you now have a basic installation of Jenkins for PHP and JS development. Plese refer to [the documentation](https://wiki.jenkins-ci.org/display/JENKINS/Home) for more details and set up your first project. Good luck and happy building!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forangecms%2Ffreebsd-jenkins-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forangecms%2Ffreebsd-jenkins-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forangecms%2Ffreebsd-jenkins-tutorial/lists"}