Skip to content

[Epic] GitLab Deploy (multiple steps, one step per release)

GitLab Deploy is continuous delivery functionality that bridges the gap between code and scheduler. For now it assumes you application consists of a set of (docker) containers that you want to deploy to a scheduler. For now we'll use Kubernetes or GCE as the scheduler but others such as Mesosphere DCOS and AWS ECS should work the same.

The tagline for GitLab Deploy can be: "Version controlled operations".

Requirements

  1. Build artifacts DONE
  2. GitLab pipeline DONE

Three files in the repo specify how your application is deployed

  1. the Dockerfile(s) specify how the containers should be build
  2. the .gitLab-ci.yml file uploads the docker containers as part of the build artifacts
  3. the Kubernetes yml file determines what constellation of containers the application needs, in Kubernetes this is called a pod.

Rails implementation

The functionality is based on two models (and corresponding database tables): deploy and environment. A deploy specifies the time when a specific commit was deployed to an environment. Shutting down an environment also counts as a deploy. And environment is similar to a pod in Kubernetes; a collection of docker containers configured in the scheduler that run an application.

The three UI steps

=> Moved to https://gitlab.com/gitlab-org/gitlab-ce/issues/20255

Notes

  1. You can also specify an environment to deploy to in .gitlab-ci.yml for automatic deployments.
  2. Both the GitLab admin and project masters can add new providers to deploy to by adding Kubernetes credentials.
  3. It should be possible to also use this for database servers that need persistent storage by using Kubernetes volumes.

Future functionality

  1. Manual confirmation of a deployment DONE
  2. Container registry DONE
  3. Tagging builds with .gitlab-ci.yml ?
  4. Releases DONE
  5. Do a partial rollout where only part of the containers will be replaced (for example if only nginx needs to be replaced).
  6. Run .gitlab-ci.yml again on the same commits to recreate docker images with more recent Ubuntu packages (if a security fix was released).
  7. Specify secrets in encrypted storage that will become Kubernetes secrets => Moved to https://gitlab.com/gitlab-org/gitlab-ce/issues/20199
  8. Add more information on the environment page if it is not available via a web interface (in Kubernetes): interactive shell, streaming logs and performance graphs.
  9. A view of what version of applications are deployed on the different environments. DONE
  10. Support for other container schedulers and PaaS platforms => Moved to https://gitlab.com/gitlab-org/gitlab-ce/issues/20199
  11. Support for non-Paas deployments: SSH, S3, iOS testflight, Maven, Artifactory and sFTP
  12. Support for Chef, Puppet, Ansible and Salt (it is not clear to me at this time how this should work, upload cookbooks, manifests, playbooks, and modules?)
  13. Offer an API to trigger deployments and read the status.
  14. Offer an API to register as a scheduler/deploy target (look at the GitHub Deploy API)
  15. In the deploy new screen you can select 'always deploy to this environment' to make future deployments one-click instead of two.

@stanhu might be interested to work on this

/cc @dzaporozhets @ayufan @DouweM @jacobvosmaer