1

I'm thinking of how to setup continuous integration and deployment using bitbucket, drone.io, hub.docker.com and swarm(aws ec2) cluster?

  1. I submit code to bitbucket
  2. bitbucket's web hook triggers drone.io and it builds and runs tests
  3. On every "green" commit, docker image is pushed to the hub.docker.com and deployed to integration environment (swarm cluster) using "latest" label.

I can't figure it out how to setup step 3 ...

Andreo
  • 597
  • 5
  • 19
  • Search for something like ,how to push docker image to docker registry ? how to install a docker image on specific node from docker registry? – Vijay Parmar Aug 22 '17 at 08:33

1 Answers1

-1

As an example, add to your .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

This would perform the publish step using the docker plugin, followed by hitting a URL endpoint to deploy the published image to your integration environment using the webhook plugin.

gjtempleton
  • 783
  • 7
  • 16