Auto deploy as just another .gitlab-ci.yml template
TLDR;
- Remove auto deploy as a separate function => just make it a single .gitlab-ci.yml template named 'Auto deploy'.
- Add PostgreSQL and Redis support => use a default helm chart with PostgreSQL and Redis to deploy apps
- Add chart for application itself => allow the .gitlab-ci.yml file to override the default helm chart
- 'Deploy to GitLab' button => support self hosted instances too
Extended version:
- Remove auto deploy as a separate function
When we made auto deploy https://docs.gitlab.com/ce/ci/autodeploy/index.html we assumed we would have templates for multiple programming languages and maybe for multiple container schedulers.
But the current template (called OpenShift) uses Herokuish to support all major platforms except dotnet, although Heroku itself has expirimental support for dotnet.
We also expected to have to add multiple files to the repository to make this work (Docker container, .gitlab-ci.yml template, chart files) but right now we get by with a .gitlab-ci.yml template that refers to a container outside the repository.
My proposal is to make it a boring solution and remove auto deploy as a separate function and just make it one 'Auto deploy' .gitlab-ci.yml template. This will limit us to the current approach (Heroku buildpacks or custom config) and Kubernetes (OpenShift, GKE, etc.) but that seems reasonable to me. We need to make it a great experience so we need to focus all our resources on making support for Kubernetes great. It is great that by using buildpacks we don't need to repeat the process for different programming languages.
- Add PostgreSQL and Redis support
We need to run PostgreSQL and Redis to have a real webapp, these are default services on Heroku. When using Docker instead of Kubernetes we allow you to set the following in the .gitlab-ci.yml file
image: ruby:2.1
services:
- postgres
that was inspired by https://docs.docker.com/compose/compose-file/
since we're now running on Kubernetes I think we should be inspired by https://github.com/kubernetes/charts/blob/master/stable/gitlab-ce/requirements.yaml so it would be:
dependencies:
- name: redis
version: 0.4.1
repository: https://kubernetes-charts.storage.googleapis.com/
But if I understand https://gitlab.com/gitlab-examples/openshift-deploy/blob/master/README.md correctly we're not really deploying https://gitlab.com/gitlab-examples/openshift-deploy/tree/master but are using that to build the container. So instead of supporting the above we can just push a default helm chart that includes our container, PostgreSQL, and Redis to Kubernetes in the deploy steps.
- Add a custom chart for the application
At some point people want to set up their own charts. We can allow people to specify a custom chart in the .gitlab-ci.yml file that would override our default helm chart files.
chart: gitlab-ce
=> a name expects the files in stable https://github.com/kubernetes/charts/blob/master/stable/gitlab-ce/Chart.yaml
chart: /wordpress => a path expects the files in the repository itself
chart: https://github.com/kubernetes/charts/blob/master/stable/gitlab-ce/` => a url expects the files at that location.
It is strange the if you define a docker image there this will be used to build the container. If you define a chart it will be used to deploy the container. But I think I can live with that.
- 'Deploy to GitLab' button
We need a deploy to GitLab button similar to https://devcenter.heroku.com/articles/heroku-button that supports repo's on GitLab.com, GitHub.com, BitBucket.org, and self hosted public GitLab repositories. So people can just paste the following in their repo.
[](https://gitlab.com/deploy)