如何设置持续集成 – 部署:bitbucket,drone.io,docker hub,swarm?

我正在考虑如何使用bitbucket,drone.io,hub.docker.com和swarm(aws ec2)集群来设置持续集成和部署?

  1. 我将代码提交给bitbucket
  2. bitbucket的web钩子触发drone.io,它构build并运行testing
  3. 在每个“绿色”提交中,docker映像被推送到hub.docker.com,并使用“latest”标签部署到集成环境(swarm集群)。

我不知道如何设置步骤3 …

作为一个例子,添加到您的.drone.yml

 publish: docker: username: octocat password: password email: octocat@github.com repo: octocat/hello-world tag: latest when: success: true deploy: webhook: urls: - https://your.webhook/... header: Authorization: pa55word X-Docker-Image: name_of_your_image:latest when: success: true 

这将使用docker插件执行发布步骤,然后敲击URL端点以使用webhook插件将发布的图像部署到集成环境。