plugins.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:jenkins-charm 作者: jenkinsci 项目源码 文件源码
def _install_plugin(self, plugins_site, plugin, wget_options):
        """Download and install a given plugin."""
        plugin_filename = "%s.hpi" % plugin
        url = os.path.join(plugins_site, plugin_filename)
        plugin_path = os.path.join(paths.PLUGINS, plugin_filename)
        if not os.path.isfile(plugin_path):
            hookenv.log("Installing plugin %s" % plugin_filename)
            command = ("wget",) + wget_options + ("-q", "-O", "-", url)
            plugin_data = subprocess.check_output(command)
            host.write_file(
                plugin_path, plugin_data, owner="jenkins", group="jenkins",
                perms=0o0744)
        else:
            hookenv.log("Plugin %s already installed" % plugin_filename)
        return plugin_path
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号