I'm currently running a backend in production and want to change our current setup to use Docker for deployment and a CI tool for testing.

Right now I have a BitBucket repository with the two main branches "develop" and "master", and two separate servers for development and production that pull the code from the respective branches via a shell script that I trigger locally. This way I test changes manually in a completely isolated environment with a dev server and dev database before merging to master and deploying to production.

git Repository            dev-server           prod-server
|                        +----------+         +----------+
|-- develop              |          |         |          |
|-- master               |  pulls   |         |  pulls   |
                         |  develop |         |  master  |
                         |          |         |          |
                         +----------+         +----------+

I want to change this by writing tests and use Docker and a CI tool like Drone (it's a Go backend) or Jenkins but I have no idea how this all plays together. I already read quite a lot about Docker and most tutorials assume you develop locally and then deploy the container directly to a production server. Also I guess the CI tool should be located on the development server?

Can anyone explain to me how the possible flows would look like in my scenario?

Example: I make a change locally and then push on "develop". The development server has a git hook that recognizes the push and somehow triggers the CI server that runs the tests. If the tests pass it COULD merge develop to master (is this CD now?), which again triggers a hook on the production server that builds the new image and runs the container. Is that right? Also which server is hosting the docker repo now?

  • 2
    Don't commit to a toolset (Docker, Drone/Jenkins, etc) until you've established your workflows' requirements. Docker adds a new layer of abstraction (and complexity) to each stage of your build/deploy processes. Also don't get hung up trying to draw a hard line between CI and CD. They're interdependent flows. You have a decent summary of one possible workflow. You should whiteboard it or build a demo. – jscott Aug 17 '16 at 13:30

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.