/git4jamfpro

A tool designed for CI/CD pipelines that uploads the most recently changed scripts and extension attributes in source control to a Jamf Pro server(s).

Primary LanguageShell

git4jamfpro

A tool designed for CI/CD pipelines that uploads the most recently changed scripts and extension attributes in source control to a Jamf Pro server(s).

This is a rewrite of the great (but very aged) git2jss python library written by badstreff.

What are the benefits of git4jamfpro?

  • Designed and packaged to be be ran in a CI/CD pipeline. We even include sample pipeline config files for CircleCI, Bitbucket, and GitHub to get you up and running quickly.
  • No python dependency; git4jamfpro is written in bash.
  • Uses modern Bearer Token authentication with Jamf Pro.
  • Allows you to download all scripts and extension attributes (EAs) in parallel from a Jamf Pro server.
  • You can update (or create) scripts/EAs locally, commit the changes to your repository, and the changed scripts/EAs are pushed to Jamf Pro automatically by your pipeline. This ensures that script/EA changes are always tracked in source control.
  • When a script/EA is updated, a backup can be left as an artifact in your CI/CD pipeline.

Setting up git4jamfpro

  1. Fork your own copy of the repository.
  2. Clone the repository locally:
git clone git@github.com:YOUR_ORGANIZATION/git4jamfpro.git (or equivalent)
  1. Traverse into the repository:
cd git4jamfpro
  1. Download your scripts/EAs:
./git4jamfpro --url <YOUR_JAMF_PRO_SERVER> \
    --username <API_USER> \
    --password <API_PASS> \
    --download-scripts \
    --download-eas
  1. Commit the repository populated with scripts/EAs to your source control:
git add .
git commit -m "initial commit with scripts/EAs"
  1. Configure your pipeline (see the Wiki for CircleCI, Bitbucket, and GitHub setup).

  2. Now you can make changes to your scripts locally, push those changes to source control, and watch your pipeline automatically update Jamf Pro 🤯.

Required Permissions

The Jamf Pro user account used with git4jamfpro must have the below permissions.

Jamf Pro Server Objects Create Read Update Delete
Computer Extension Attributes ✓ ✓ ✓
Scripts ✓ ✓ ✓