gkluoe / git2jss Goto Github PK
View Code? Open in Web Editor NEWRelease control for JSS scripts
License: GNU General Public License v3.0
Release control for JSS scripts
License: GNU General Public License v3.0
Currently, the default behaviour is to store the JSS credentials in a plain text file (the python-jss module's preferences file). It would be much better to integrate with keychain, or at least allow an option to prompt for a password every time.
On inspection of the code it's just broken. Maybe it should be removed though - it's arguably not this tool's job to create the tag if it doesn't exist.
I'm having problems with the new version, not sure how to diagnose. The source file is not found, but it is indeed in Git. I tried both relative and full path. I also tried using --tag
. Any ideas?:
$ git2jss --file "Uninstallers/Uninstall Enpass.sh" --name "Uninstall Enpass" --branch master
Running in Script mode
Remote: origin
From [email protected]:mac/jamf-scripts.git
Git remote: [email protected]:mac/jamf-scripts
Checked out repo at master.
Loaded Uninstall Enpass from the JSS
Cleaning up tmpdir /var/folders/7r/89m62qjn1rnf0lm0cfjj08qw0000gp/T/tmpCilYYN
Traceback (most recent call last):
File "/usr/local/bin/git2jss", line 9, in <module>
load_entry_point('git2jss==2.0.0', 'console_scripts', 'git2jss')()
File "build/bdist.macosx-10.14-intel/egg/git2jss/__init__.py", line 196, in main
File "build/bdist.macosx-10.14-intel/egg/git2jss/processors.py", line 95, in __init__
File "build/bdist.macosx-10.14-intel/egg/git2jss/processors.py", line 42, in __init__
File "build/bdist.macosx-10.14-intel/egg/git2jss/processors.py", line 65, in _load_source_file
File "build/bdist.macosx-10.14-intel/egg/git2jss/vcs.py", line 226, in get_file
File "build/bdist.macosx-10.14-intel/egg/git2jss/vcs.py", line 208, in path_to_file
git2jss.vcs.FileNotFoundError: Couldn't find file Uninstall Enpass.sh at tag/branch master
$ git2jss --file "/Users/gpugh/sourcecode/jamf-scripts/Uninstallers/Uninstall Enpass.sh" --name "Uninstall Enpass" --branch master
Running in Script mode
Remote: origin
From [email protected]:mac/jamf-scripts.git
Git remote: [email protected]:mac/jamf-scripts
Checked out repo at master.
Loaded Uninstall Enpass from the JSS
Cleaning up tmpdir /var/folders/7r/89m62qjn1rnf0lm0cfjj08qw0000gp/T/tmpVHr3TM
Traceback (most recent call last):
File "/usr/local/bin/git2jss", line 9, in <module>
load_entry_point('git2jss==2.0.0', 'console_scripts', 'git2jss')()
File "build/bdist.macosx-10.14-intel/egg/git2jss/__init__.py", line 196, in main
File "build/bdist.macosx-10.14-intel/egg/git2jss/processors.py", line 95, in __init__
File "build/bdist.macosx-10.14-intel/egg/git2jss/processors.py", line 42, in __init__
File "build/bdist.macosx-10.14-intel/egg/git2jss/processors.py", line 65, in _load_source_file
File "build/bdist.macosx-10.14-intel/egg/git2jss/vcs.py", line 226, in get_file
File "build/bdist.macosx-10.14-intel/egg/git2jss/vcs.py", line 208, in path_to_file
git2jss.vcs.FileNotFoundError: Couldn't find file Uninstall Enpass.sh at tag/branch master
Hi again (oh no not me again!)
I just attempted to install git2jss on a new Mac (running 10.14.6) and the installation fails due to keyring not installing properly. It looks like an issue with the method of installation using easy_install
. I was able to proceed by running sudo pip install keyring
instead, and then running sudo python setup.py install
once again.
Error output, in case useful:
$ sudo python setup.py install
running install
Checking .pth file support in /Library/Python/2.7/site-packages/
/usr/bin/python -E -c pass
TEST PASSED: /Library/Python/2.7/site-packages/ appears to support .pth files
running bdist_egg
running egg_info
writing requirements to git2jss.egg-info/requires.txt
writing git2jss.egg-info/PKG-INFO
writing top-level names to git2jss.egg-info/top_level.txt
writing dependency_links to git2jss.egg-info/dependency_links.txt
writing entry points to git2jss.egg-info/entry_points.txt
reading manifest file 'git2jss.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'README.md'
writing manifest file 'git2jss.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.14-intel/egg
running install_lib
running build_py
creating build/bdist.macosx-10.14-intel/egg
creating build/bdist.macosx-10.14-intel/egg/git2jss
copying build/lib/git2jss/jss_keyring.py -> build/bdist.macosx-10.14-intel/egg/git2jss
copying build/lib/git2jss/__init__.py -> build/bdist.macosx-10.14-intel/egg/git2jss
copying build/lib/git2jss/vcs.py -> build/bdist.macosx-10.14-intel/egg/git2jss
copying build/lib/git2jss/exceptions.py -> build/bdist.macosx-10.14-intel/egg/git2jss
copying build/lib/git2jss/processors.py -> build/bdist.macosx-10.14-intel/egg/git2jss
byte-compiling build/bdist.macosx-10.14-intel/egg/git2jss/jss_keyring.py to jss_keyring.pyc
byte-compiling build/bdist.macosx-10.14-intel/egg/git2jss/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.14-intel/egg/git2jss/vcs.py to vcs.pyc
byte-compiling build/bdist.macosx-10.14-intel/egg/git2jss/exceptions.py to exceptions.pyc
byte-compiling build/bdist.macosx-10.14-intel/egg/git2jss/processors.py to processors.pyc
creating build/bdist.macosx-10.14-intel/egg/EGG-INFO
copying git2jss.egg-info/PKG-INFO -> build/bdist.macosx-10.14-intel/egg/EGG-INFO
copying git2jss.egg-info/SOURCES.txt -> build/bdist.macosx-10.14-intel/egg/EGG-INFO
copying git2jss.egg-info/dependency_links.txt -> build/bdist.macosx-10.14-intel/egg/EGG-INFO
copying git2jss.egg-info/entry_points.txt -> build/bdist.macosx-10.14-intel/egg/EGG-INFO
copying git2jss.egg-info/requires.txt -> build/bdist.macosx-10.14-intel/egg/EGG-INFO
copying git2jss.egg-info/top_level.txt -> build/bdist.macosx-10.14-intel/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/git2jss-2.0.0-py2.7.egg' and adding 'build/bdist.macosx-10.14-intel/egg' to it
removing 'build/bdist.macosx-10.14-intel/egg' (and everything under it)
Processing git2jss-2.0.0-py2.7.egg
Removing /Library/Python/2.7/site-packages/git2jss-2.0.0-py2.7.egg
Copying git2jss-2.0.0-py2.7.egg to /Library/Python/2.7/site-packages
git2jss 2.0.0 is already the active version in easy-install.pth
Installing git2jss script to /usr/local/bin
Installed /Library/Python/2.7/site-packages/git2jss-2.0.0-py2.7.egg
Processing dependencies for git2jss==2.0.0
Searching for keyring
Reading https://pypi.python.org/simple/keyring/
Best match: keyring 19.0.2
Downloading https://files.pythonhosted.org/packages/69/91/5a9d1769ed7e25083649e87977686423aebed3516112557f4cafd73c9f95/keyring-19.0.2.tar.gz#sha256=1b74595f7439e4581a11d4f9a12790ac34addce64ca389c86272ff465f5e0b90
Processing keyring-19.0.2.tar.gz
Writing /tmp/easy_install-wqlhi3/keyring-19.0.2/setup.cfg
Running keyring-19.0.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-wqlhi3/keyring-19.0.2/egg-dist-tmp-3JuH3z
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'use_scm_version'
warnings.warn(msg)
warning: install_lib: 'build/lib' does not exist -- no Python modules to install
zip_safe flag not set; analyzing archive contents...
Removing /Library/Python/2.7/site-packages/UNKNOWN-0.0.0-py2.7.egg
Copying UNKNOWN-0.0.0-py2.7.egg to /Library/Python/2.7/site-packages
UNKNOWN 0.0.0 is already the active version in easy-install.pth
Installed /Library/Python/2.7/site-packages/UNKNOWN-0.0.0-py2.7.egg
error: The 'keyring' distribution was not found and is required by git2jss
I'm not really used to using tags, and have started to use them for the purposes of experimenting with git2jss. Tags are supposed to represent signficant landmarks in a project, but seem overkill for a small repo of continually updated/amended and unrelated JSS scripts.
If I'm editing and fixing a script that I need to upload to the JSS to test, and then need to amend, it means continually either creating new tags or amending an existing one, in order to be able to upload the script.
So, tags are nice to have, but it would be cool if git2jss worked without it. If --tag vX.Y
was omitted, it could perhaps grab the latest tag if the file is aligned with one. Or it could just grab the commit ID if no tags are present, or the file is not aligned with a particular tag.
Another optional --version X.Y
could give people the ability to specify a version for the purposes of filling in the @@VERSION
field without using tags.
git2jss fails when calling a full path to a file. You have to stay at the base of the repo for git2jss to find the file.
This fails:
cd /path/to/jss-scripts-repo
cd subfolder
git2jss --no-keychain --file myscript.sh --name "My Script" --tag v0.2
This fails:
git2jss --no-keychain --file /path/to/jss-scripts-repo/subfolder/myscript.sh --name "My Script" --tag v0.2
This works:
cd /path/to/jss-scripts-repo
git2jss --no-keychain --file subfolder/myscript.sh --name "My Script" --tag v0.2
I guess it's clear that it's only looking in the current directory for git information. But perhaps it could add some intelligence to traverse directories until it finds that information, or else to supply the base directory. This would help when using git2jss in automation.
Hi, probably not an important one, but I recently screwed up my path experimenting with a Homebrew installation method, and afterwards git2jss
failed with OSError: [Errno 2] No such file or directory
. It came down to needing /sbin
in my $PATH
. I lazily have not gone through the code to determine which command is being run that doesn't specify the path, but it's somewhere :)
Would it be useful to have an option to pull scripts from the JSS and write them to local files?
Could be used during development to easily transfer changes from a dev instance to git, ready to be pushed to a test/live instance...
When operating dev and test servers, I might want to push scripts to both servers - a simple way to do this would be to be able to specify the preferences file on the commandline.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.