In this proposal I would like to show you how to use a Docker Swarm within your GitLab Repository for Pipelines and Environments
Introduction
Outlines
If we comes their that means that we have our project on Gitlab, and we wants to automatically deploy it on a Docker Swarm cluster.
For that purpose, I will show you how to create a Docker Swarm cluster using Play-With-Docker. Note, that this method is only for you to ease to follow this tutorial, but the Play-with-docker cluster will only be available for 4 hours, afterwards it will be discarded. So If you have a Swarm Cluster on your own It would be better to uses yours.
The goal it to build, test and deploy to a docker swarm the docker voting app example.
The deployment will be done on Play-with-docker instances, where we set-up a One docker swarm instance, deploy Traefik loadbalancer, in order to proxify requests to our voting application, then deploy the voting app.
I'm hesitating between a customer storie or a tutorial on how we actually use gitlab to deploy each branch in a fully testable live environment on either a Docker Swarm backend or a CloudFoundry backend (maybe it's need to separate post, one for each ?).
The problem is solves is to accelerate project delivery time and increase quality of code : each git push will be unitary tested, then gitlab will create a fully testable environment in which we could set-up more than just 1 app and make end-to-end integration test.
It is interesting for us because it shows a use case how to benefit from tracability (GitLab logs everything), automation for each steps of deployment, all in only one place : GitLab
Tools needed : GitLab instance, a Docker Swarm cluster for deployment on it, a CloudFoundry environment for deployment on it, gitlab runners with API access to either Docker Swarm and CloudFoundry.
Hi @batjko@paoloyx, didn't have time to work on it until now but I can found some now. @marcia are you interested ? I could try to demo this using a swarm with play-with-docker
+1 for this - going through deploying this way now (using docker swarm and secret variables with Gitlab CI) this tutorial would have been awesome to have - mainly connecting to a remote swarm and deploying to it
are you interested? I could try to demo this using a swarm with play-with-docker
Yes, @allamand we're interested in this tutorial :) Though please advise, we're changing the rules of the Community Writers program; I'll link them from here as soon as they're live. What you could do now is making your demo work first, then, if you're okay with the new rules, we'll be able to move forward.
@marcia, I've just update the description and I have a project demo which can be use as base (not quite finished). But I'm out of office next 2 weeks, so a reasonable ETA should be 31/08 ?
@allamand thank you! Here's my general feedback over the content you added to this issue's description:
-1. It's too much for an introduction, you need to be more concise than that. ;)
-2. From what you defined as your audience:
This is for DevOps users with intermediate experience which wants to see how to quickly and easily use GitLab-ci to deploy on a Docker Swarm Cluster
And your requirements:
It may be a GitLab account, and a Docker Swarm available, and flows open from a gitlab-runner instance to the docker swarm.
I understand this is a tutorial, or a user guide, not a technical overview. Correct? ref If so, you should of course, briefly introduce the subject, then go right over the how-to.
If you have no docker swarm we will try to use one on Play-With-Docker
I wanted to update the introduction in the issue but I've got an error for now while trying to edit..
@allamand this might have happened when we were deploying a new patch release or smt like that. Could you please try again? If it doesn't work, I'd ask you to please open a new issue in CE explaining what is happening, then ping me there :)
@allamand thanks for the link, but this draft is technically published and available publicly. If you want to submit it to the community writers program, please take the content offline.
Community Writers Program - terms and conditions - requirements:
Content must be original, comprehensible, technical, and unprecedented.
Please read "original and unprecedented" as unpublished. ;)
@allamand from your draft, the general feedback is: it's overwhelming, we can't accept it as is. You need to focus on your article's main subject: "how to use a Docker Swarm with GitLab CI/CD and multiple environments". Adjust the title for a How-to, and make your content a very straight tutorial:
short intro
step 1
step 2
step...
conclusion
Please reduce it to at least 50% of your draft, then ping me back.
@marcia, sorry for mistake, i've unpublished the content.
No worries, thank you. :)
How will I send you new version?
Let's do it step by step. I took a look at your draft because you linked from here, and I thought would be important to let you know it was too long. But let's focus on the intro and the outlines first.
Please take your time to have a second look at the steps to getting published. It's essential that you are familiar with the process.
I know you're having trouble updating this issue's description, so please add them (intro and outlines) in comments to this thread.
@marcia, Please find below the intro, and the toc (still have problem to edit the issue)
Introduction
GitLab offers very powerful to create Continuous Integration & Deployment Pipelines for each of your product/projects. The Goal is to have code frequently pushed, built, tested and deployed, in an automated way you previously defined.
In this tutorial I will show you how to automatically benefits from such a pipeline to build an Application composed of several Containerized service with Docker, and to deploy it to a Docker Swarm container orchestrator that will be in charge of spawning and scale the containers, dispatching theme on the servers and activate network communications. The same approach can be used to deploy to others orchestration services such as Kubernetes or CloudFoundry.
GitLab manage our project application source code, and we leverage GitLab CI to manage our Continuous Delivery pipeline. We define a single YAML file which describe the process in which we can create an unlimited number of jobs that will be executed by GitLab.com public Runners (but you could also easilly setup your own runners).
With this step-by-step tutorial I will show you how to uses GitLab.com to :
@axil, the first proposal was to cover both swarm & cloudfoundry, but there is too much content, so I only deal with docker swarm in this one (and anyone can reproduce the tutorial), it will be more difficult with cloudfoundry I don't know if it exists some kind of play-with-cloudfoundry to help following the tutorial
Achilleas Pipinellischanged title from Using Gitlab for CI/CD on Docker-swarm & Cloud Foundry Environments to Using Gitlab for CI/CD on Docker-swarm
changed title from Using Gitlab for CI/CD on Docker-swarm & Cloud Foundry Environments to Using Gitlab for CI/CD on Docker-swarm