Skip to content

Use git as the source of truth for your scripts! Utilizes CI/CD pipelines that uploads the most recently changed scripts to a Jamf Pro server.

License

Notifications You must be signed in to change notification settings

74k1/jamfGitSync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jamfGitSync

Use git as the source of truth for your scripts! Utilizes CI/CD pipelines that uploads the most recently changed scripts to a Jamf Pro server.

This is a rewrite of git4jamfpro (which is a rewrite of git2jss). Both very good scripts, however I quickly found out both of them still use the classic API endpoint and not the new Jamf Pro API Endpoint. (I also preffered json instead of xml files)

Benefits of the above mentioned alternatives

  • No python dependency
  • No xmlstarlet dependency
  • Uses Client ID & Client Secrets through API roles and clients instead of Bearer Auth
  • Allows you to upload very large scripts (INSTALLOMATOR for example)
  • Allows you to download all scripts in parallel from a Jamf Pro server

Usage

Requirements

  • A Jamf Pro instance (ofcourse)

  • A git vcs server (github, bitbucket, ...)

  • jq installed

  • A generated Client ID & Client Secret for your Jamf Pro instance

    • Permissions required: required_permissions

      in Text..
      • Create Scripts
      • Read Scripts
      • Update Scripts
      • Create Computer Extension Attributes
      • Create Mobile Device Extension Attributes
      • Create User Extension Attributes
      • Read Computer Extension Attributes
      • Read Mobile Device Extension Attributes
      • Read User Extension Attributes
      • Update Computer Extension Attributes
      • Update Mobile Device Extension Attributes
      • Update User Extension Attributes
  • A CI/CD tool for automation (Jenkins, CircleCI, Bitbucket Pipelines, GitHub Workflows, ...)

Steps

  1. Fork / Download this repository

  2. Download all of your current scripts & extension attributes:

./jamfScriptSync.sh --url <YOUR_JAMF_PRO_SERVER> \
    --clientid <API_Client_ID> \
    --clientsecret <API_Client_Secret> \
    --download-scripts \
    --download-eas
  1. Commit the repository populated with scripts to your git:
git add .
git commit -a -m "feat(init): initial setup"
  1. Push this commit to your own repository. (wherever you'll want to have those scripts stored)

Next Steps

After you're done with the initial setup, your Pipelines could look something like this (ofcourse this depends on your own setup, and these are just examples):

Now you can make changes to your scripts in your own repository, push those changes to git and watch your CI/CD do the rest of the job. 😄

Contribution

All contributions are greatly appreciated! It'd make my day if you could read the Contribution Guidelines first.

I'm looking forward to your suggestions / improvements. :)

About

Use git as the source of truth for your scripts! Utilizes CI/CD pipelines that uploads the most recently changed scripts to a Jamf Pro server.

Topics

Resources

License

Stars

Watchers

Forks

Languages