I’ve been using osTicket since the beginning of my IT business. Probably around 2009. osTicket is a brilliant piece of FREE software written in PHP. It can run on almost all web hosting scenarios and is an amazing Support Ticket solution.
Recently the legends over at osTicket have released the latest stable version v1.11 into the wild. Presumably countless hours went into this new edition and all of this beautiful code is FREE for you and me 🙂 So a massive shout out to the guys over at osTicket and God bless.
In comes git
Now the reason for this post is to demonstrate how to use Git (which the osTicket developers use to make changes publicly to the source code). I’ve struggled to understand the concept myself (so many terms and no real time to just push through) but today the legend with the online name @JediKev has made the murky waters clear for me 🙂 Here is the steps for everyone else in case you didn’t know how as well.
Before we start I just want to make a few points in relation to my setup and you will need to change the commands below to suit your scenario:
I use WHM/cPanel so this is why my locations look like below
– Git staging area = /home/USERNAME/osTicket-git
– Public html location = /home/USERNAME/public_html/support
To manage all this you will need to have shell access to your hosting. Not all hosting providers give this, but TechCare does. Come join the fun group over here and get a unique experience and friendly help.
Alright so onto the process:
- mkdir /home/USERNAME/osTicket-git/
- git clone https://github.com/osTicket/osTicket.git /home/USERNAME/osTicket-git/
- cd /home/USERNAME/osTicket-git/
- git fetch origin
- git checkout 1.11.x
- git fetch origin
- git merge
- php manage.php deploy /home/USERNAME/public_html/support
As you can see from above the process is not long or tiresome. From here on out you can pull down the latest version from the public branch (which you can change by the way using git checkout command). Then you deploy it using osTicket Team’s CLI to your publicly accessible folder. This is why it is called a “staging” area. Pull down the new files, then deploy them at your leisure.
Single commit
If you want to pull just a single commit (e.g. pull request made by @JediKev 4732) then use a variant of the following commands:
- cd /home/USERNAME/osTicket-git/
- git fetch origin pull/4732/head:JediKev/pull-4732
- git merge JediKev/pull-4732
- php manage.php deploy /home/USERNAME/public_html/support
Give it a try and welcome to the wonderful world of git 🙂 Here is the response by @JediKev that gave me what I needed to write this post.
As always have a blessed day and may God be praised.
Steven Swarts