将脚本从git repo推送到jss。包括模板和标记。

git2jss的Python项目详细描述


https://dev.azure.com/gklee/git2jss/_apis/build/status/gkluoe.git2jss?branchName=master

吉特2JSS

版本:v2.0.1

作者:geoff lee

概述

问题:如何确保对jamf jss中的脚本和computerextensionattributes所做的所有更改都被记录、可逆并与源代码管理中的内容匹配?

答案:努力做到零

使用git2jss,在开发/测试环境中对jss脚本或cea进行更改并将其推送到git存储库后,您可以将带标记的副本导出到jss,并在“notes”字段中填写git changelog。还原更改与导出以前标记的版本一样简单。

还可以在连续集成管道中使用此脚本将脚本从给定分支的头部导出到JSS

还支持一些重要值的模板化,因此脚本会自动包含上次更改的详细信息,以及它们在源代码管理中的位置。

默认情况下,密码存储在系统密钥链中

安装/使用

注意:需要python-jsskeyring模块。如果手动安装,则需要确保它们存在。 通过pip安装应该会帮你解决这个问题。

通过PIP安装

如果要安装到virtualenv中

^{tt3}$

应该是你需要做的。

如果安装到OS X 10.13上而不使用Virtualenv, 您需要使用sudo,并安装缺少的依赖项:

^{tt4}$

^{tt5}$

或手动

克隆repo并运行安装脚本

^{tt6}$

^{tt7}$

示例

命令行

您可以在命令行上使用它,如下所示:

# Export the file localscript.sh to a Script object on the JSS called do_something_great.sh
# using the existing tag v0.0.9

$ git tag v0.0.9 && git push origin v0.0.9
$ git2jss --file localscript.sh --name do_something_great.sh --tag v0.0.9

# Export the file run-softwareupdate.py at the head of the master branch
# to an object on the JSS with the same name

$ git2jss --file run-softwareupdate.py --branch master

# Export the file check_firewall.sh to a ComputerExtensionAttribute object on the JSS called
# FirewallCheck, using the existing tag v0.0.9

$ git2jss --mode ComputerExtensionAttribute --file check_firewall.sh --name check-firewall --tag v0.0.9

# Export each script in the current folder that has a script object on the server
# with a matching name, and exists at tag v1.0.2

$ git2jss --all --tag v1.0.2

# Or do the same for all files at the head of branch 'production'

$ git2jss --all --branch production

# Show information about the currently configured JSS (or enter details if none configured)

$ git2jss --jss-info

模板化

以下变量(如果嵌入到脚本中)将在传输到jss时替换为指示值

VariableValue
^{tt8}$If –tag was used: The name of the git tag that you have specified (eg v1.0.1) If –branch was used: The commit hash of the last change of the file, and a note of the branch
^{tt9}$Assuming you have a git remote called ‘origin’, the URL thereof (eg https://github.com/uoe-macos/jss)
^{tt10}$The name of the file in the git repository identified by @@ORIGIN``
^{tt11}$The date of the last change of the file in Git
^{tt12}$The username used by git2jss to authenticate to the JSS at the time the script was exported
^{tt13}$The entire Git log for this script, formatted thus: ^{tt14}$

@@LOG用于在JSS中构造“Notes”字段,覆盖以前存在的任何内容

贡献

欢迎提出问题和请求

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java testNG优先级和依赖性   java JPQL:以下WHERE子句使用继承时出现问题   java是否可以在JTable渲染器中进行查询?   java如何在javascript中向url添加变量并使用@PathVariable获取   在外部jframe中显示java控制台   java I无法连接到IBM MQ的QM错误2035 MQRC\u未授权   apache zookeeper如何解决Storm应用程序在本地集群中运行时出现的错误“java.net.ConnectException:连接被拒绝:connect”?   读取第一行的java文本文件具有键和第二行前进值   java在哪个线程池中affinityRun提交任务?如何配置线程数?   Java拆分字符串正则表达式:前导空格   如何在Java中读取Pop3服务器中的入站电子邮件   带/不带布局管理器的swing Java定位GUI组件   在Spring Webflux中使用域设置java多会话ID   http Java web将其内容刮除,但只刮除正文样式,然后不退出并永远运行   java图形绘制组件和循环故障