Hi there. I’m Colby Bouma, a shiny new employee at PDQ.com on the QA team. I used PDQ extensively at my previous job and I did some crazy things with it. Today I would like to share one of those crazy things with you. It’s important to know I tend to go a little over the top occasionally 😀
Have you ever wanted a detailed history of the changes you’ve made to PDQ Deploy and Inventory? You can accomplish this with the built in Export feature and your own git repository. The Export feature creates XML files which are fairly readable and work very well with git. If you follow my workflow of exporting and committing after every change you get some handy benefits:
Quickly find when a change was made
See exactly what changed
Keep notes on why you made a change
Create a sort of undo button by importing a snippet of XML
a. Create a virtual machine with at least 2GB RAM, 20GB HDD, and 1 CPU core. You can use your favorite Linux distro, but I chose Ubuntu 16.04 for this demo. I followed to install Gitlab.
sudo apt-get install curl openssh-server ca-certificates postfix
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
sudo apt-get install gitlab-ce
c. You should now be able to log into your Gitlab webpage and change the root password.
d. Create a user account for yourself. It’s never a good idea to run as root.
3. Install Git on your workstation. The defaults are fine.
git clone http://lnxDEMO/colby/PDQ_Settings.git
git add .\Deploy_Settings.xml
git commit -m “Initial commit”
git push -u origin master
Perform an export after making any change. If you need to make multiple changes, do them one at a time and export after each change. This makes it much easier to look through and encourages detailed notes instead of “Huh, looks like I changed some stuff”.
1. Perform an export and save over the previous file.
2. Commit all changed files:
git commit -a
3. Press “i” to enter INSERT mode.
4. Write a comment such as “Increase ‘Backups to Keep’ to 200”. I also like to make a note of the path to the item I have changed, such as “Database –> Backups to Keep”. The first line is a brief note to summarize the commit; everything below that can be as detailed as you want. Make sure to put a blank line after the first line if you are going to write detailed notes.
5. To save and close the comment hit the ESC key, type “:x”, and hit ENTER.
6. Synchronize with Gitlab:
git push origin master
(If you make multiple changes you can wait to do this step until you’re done.)
1. Find the snippet of code you want to restore.
2. Copy and paste it into a text editor. In this example I had to rearrange it a little bit due to how the diff was formatted. For packages you want everything between <Package> and </Package>.
3. Save it as an XML file.
4. Import it.