从.travis.yml文件生成dockerfile的脚本
travis2docker的Python项目详细描述
从.travis.yml文件生成dockerfile的脚本
- 免费软件:BSD许可证
安装
pip install travis2docker
用法
TravisFile2DockerFile回购URL分支
- 或有拉取请求
- travisfile2dockerfile repo_url pull/
在repo_url中使用github的ssh url。
- 有关详细信息,请执行:
- travisfile2dockerfile–帮助
- 示例:
- travisfile2dockerfile–根路径=$home/t2d git@github.com:vauxoo/forecast.git 8.0
- 输出为:
- ${home}/t2d/script/git_github.com_vauxoo_forecast.git/8.0/1${home}/t2d/script/git_github.com_vauxoo_forecast.git/8.0/2
第一个是envtests=1的构建,第二个是具有lint_check=1
的env的构建。- 生成图像:
- ${home}/t2d/script/git_github.com_vauxoo_forecast.git/8.0/1/10 build.sh
- 创建容器:
- ${home}/t2d/script/git_github.com_vauxoo_forecast.git/8.0/1/20-run.sh–entrypoint=bash
- 运行测试(进入容器的):
- /entrypoint.sh
取决于
不带密码的ssh密钥
Dockerfile不支持输入密码的提示,因此需要从ssh密钥中删除它。
export fname=~/.ssh/id_rsa cp ${fname} ${fname}_with_pwd openssl rsa -in ${fname} -out ${fname}_without_pwd cp ${fname}_without_pwd ${fname}
下载大图
travis2docker使用一个默认映像,其中预装了许多软件包。
docker pull vauxoo/odoo-80-image-shippable-auto
注意:您可以定义一个自定义图像,用于–docker image参数。
例如,如果要使用Travis的原始图像,可以添加以下参数:
–docker image=quay.io/travisci/travis-python–docker user=travis
开发
要运行所有测试,请运行:
tox
注意,要合并来自所有tox环境的覆盖率数据,请运行:
Windows | ^{pr 4}$ |
---|---|
Other | ^{pr 5}$ |
更改日志
3.0.0(2016-07-26)
- pypi上的第一个版本。