聚四氯化碳容器根
polysquare-travis-container的Python项目详细描述
创建不带根目录的自包含包管理安装 进入。
这允许您将一组预定义的包安装到目录 然后使用安装在 目录。
支持Windows、OS X和Linux。
在windows和os x上,安装了本地版本的chocobely和brew 分别将包安装到指定文件夹。命令 执行时设置环境变量,以便 已安装的软件包将由使用 psq-travis-container-exec包装器。只有主机架构是 支持。
在Linux上,`proot<;http://proot.me>;``用于“容器化”一个 下载的Linux发行版,其中包管理仅在 下载的Linux发行版存在的目录。这个 允许您使用apt-get或yum安装软件包 触摸其他系统文件。prootallow允许不同的 还要指定体系结构,这些体系结构是透明模拟的 使用qemu-user-mode工具。
对于Linux,还提供了一个可选的“本地”选项,它不 招致^ {TT5}$$的开销,但不灵活。可悲的是 travis ci,proot不再正常工作,因此后者 操作模式是必需的。
状态
| travis ci(ubuntu)appveyor(windows)覆盖范围pypi| 执照| |———————————————————|--|---| |`|他们{a2}>;` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `{{{{}` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `u124;`许可证<;http://github.com/polysquare/polysquare-travis-container>;`
注意事项
不能在32位体系结构上模拟64位可执行文件。
安装
polysquare-travis-container可以使用^{tt10}安装$ 来自PYPI
创建容器
可以使用psq-travis-container-create:
创建容器usage: psq-travis-container-create [-h] [--distro {Fedora, Debian, Ubuntu, Windows, OSX}] [--release RELEASE] [--arch {ppc,x86_64,x86,arm}] [--repositories REPOSITORIES] [--packages PACKAGES] CONTAINER_DIRECTORY Create a Travis CI container If an arg is specified in more than one place, then command-line values override environment variables which override defaults. positional arguments: CONTAINER_DIRECTORY Directory to place container in optional arguments: -h, --help show this help message and exit --distro {Fedora,Debian,Ubuntu,Windows,OSX} Distribution name to create container of [env var: CONTAINER_DISTRO] --release RELEASE Distribution release to create container of [env var: CONTAINER_RELEASE] --arch {ppc,x86_64,x86,arm} Architecture (all architectures other than the system architecture will be emulated with qemu) [env var: CONTAINER_ARCH] --repositories REPOSITORIES A file containing a list of repositories to add before installing packages. Special keywords will control the operation of this file: {release}: The distribution release (eg, precise) {ubuntu}: Ubuntu archive URL {launchpad}: Launchpad PPA URL header (eg, http://ppa.launchpad.net) --packages PACKAGES A file containing a list of packages to install
分发文件系统本身位于 CONTAINER_DIRECTORY,因此多个分发配置可以是 放在一个CONTAINER_DIRECTORY中。一小部分 proot也将放在CONTAINER_DIRECTORY中。这个目录 应该缓存,例如:
cache: directories: - CONTAINER_DIRECTORY
只有在创建容器并且 未从缓存还原。要安装其他软件包,travis 应删除缓存。
像/tmp和/home这样的特殊目录被链接 自动运行,因此您可以直接从 项目根目录。
使用容器
要在容器中运行命令,请使用psq-travis-container-exec:
usage: psq-travis-container-exec [-h] [--distro {Fedora, Debian, Ubuntu, Windows, OSX}] [--release RELEASE] [--arch {ppc,x86_64,x86,arm}] --cmd [CMD [CMD ...]] CONTAINER_DIRECTORY Use a Travis CI container If an arg is specified in more than one place, then command-line values override environment variables which override defaults. positional arguments: CONTAINER_DIRECTORY Directory to place container in optional arguments: -h, --help show this help message and exit --distro {Fedora,Debian,Ubuntu,Windows,OSX} Distribution name to create container of [env var: CONTAINER_DISTRO] --release RELEASE Distribution release to create container of [env var: CONTAINER_RELEASE] --arch {ppc,x86_64,x86,arm} Architecture (all architectures other than the system architecture will be emulated with qemu) [env var: CONTAINER_ARCH] -- [CMD [CMD ...]] Command to run inside of container
CMD中的可执行文件相对于分发容器进行解析, 所以运行bash将运行CONTAINER_DIR/bin/bash,而不是 /bin/bash在特拉维斯里面。
--container、--release和--arch选项用于 选择已存在的分发容器 psq-travis-container-create。