0

持续集成与自动发布

 2 years ago
source link: https://3wapp.github.io/Docker/%E6%8C%81%E7%BB%AD%E9%9B%86%E6%88%90%E4%B8%8E%E8%87%AA%E5%8A%A8%E5%8F%91%E5%B8%83.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

1. Docker Hub 持续集成服务

Docker Hub 自身通过 配置 就可以充当持续集成服务,从而在每次推送 Git 提交后自动进行构建。

这种方式不能直接将镜像推送到Docker Hub上,Docker Hub会自己从repo进行拉取并构建镜像,从而保证整个过程中没有错误。

1.注册登录 Docker Hub

2.绑定GitHub账户(user menu->Settings->Linked Account & Services->Link GitHub->Public and Private)

3.创建自动构建(Create menu-> Create Automated Build)

4.选择Github,选择一个含有 Dockerfile 的项目

5.输入自动构建的 名字 和简要描述,创建

6.配置Build Settings, 定制化 Dockerfile路径 和 tag name

7.Github关联项目的分支(与Build Settings对应)一旦有push,Docker Hub会自动开始构建

8.选择 Build Details 查看构建错误或成功信息

2. CircleCI

CircleCI 是一个持续集成与发布平台,支持Docker容器进行测试。只需要提供一个Dockerfile,CircleCI会据此构建镜像,并启动一个新容器,然后在其中运行测试

1.SSH到测试容器(可以想办法翻墙咯)

1.注册,使用github帐号完成注册

CircleCI 持续部署

工作流程:

1.在本地功能分支上完成应用代码。

2.在GitHub上发起一个到master分支的Pull Request。

3.在Docker容器上运行自动测试。

4.如果测试通过,手动将这个PR merge进master分支。

5.一旦merge成功,再次运行自动测试。

6.如果第二次测试也通过,就在Docker Hub上对应用进行构建。

7.一旦构建完成,自动化地部署到生产环境。

1.circle.yml必须在project root directory,不同与Docker Hub可以定制化Dockerfile路径

3. Daocloud 国内


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK