Git2jss
Easily sync your scripts and EA's from a git repo with the JSS
Install / Use
/learn @badstreff/Git2jssREADME
git2jss
A fast asynchronous python library for syncing your scripts in git with your JSS easily. This allows admins to keep their script in a version control system for easy updating rather than googling and copy-pasting from resources that they find online.
Getting Started
- Fork the Project
- Install Python version 3.6 or higher. (this is because of the async requirements)
- Run
python3.6 -m pip install -r requirements.txtto install required modules - Run
./tools/download.py --url https://your.jss.url:8443 --username api_userto download all scripts and extension attributes to the repository - Run
./sync.py --url https://your.jss.url:8443 --username api_userto sync all scripts back to your JSS
Optional flags for download.py:
--passwordfor CI/CD (Will prompt for password if not set)--do_not_verify_sslto skip ssl verification--overwriteto overwrite all scripts and extension attributes
Optional flags for sync.py:
--passwordfor CI/CD (Will prompt for password if not set)--do_not_verify_sslto skip ssl verification--overwriteto overwrite all scripts and extension attributes--limitto limit max connections (default=25)--timeoutto limit max connections (default=60)--verboseto add additional logging--update_allto upload all resources in./extension_attributesand./scripts--jenkinsto write a Jenkins file:jenkins.propertieswith$scriptsand$easand compare$GIT_PREVIOUS_COMMITwith$GIT_COMMIT
ConfigParser (Optional):
A config file can be created in the project root or the users home folder. When a config file exists, the script will not promt for a password.
A jamfapi.cfg file can provide the following variables:
- username
- password
- url
Prerequisites
git2jss requires Python 3.6 and the python modules listed in requirements.txt
Deployment
The project can be ran ad-hoc with the example listed above, but ideally you setup webhooks and integrate into a CI/CD pipeline so each time a push is made to the repo your scripts are re-uploaded to the JSS.
Contributing
PR's are always welcome!
Related Skills
node-connect
341.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.6kCommit, push, and open a PR
