Simplify `.gitlab-ci.yml` on serverless projects
Problem to solve
Users currently have to define both gitlab-ci.yml
and serverless.yml
files in their repo to get started, however, the gitlab-ci.yml
template does not require any customized content and can be greatly simplified.
Once this layer is abstracted from the user, we can change the way we do serverless builds (ie bring them to GitLab CI instead of Knative build if desired) and in turn we make it easier to get started with Serverless.
Target audience
-
Sasha, Software Developer, https://design.gitlab.com/research/personas#persona-sasha
-
Devon, DevOps Engineer, https://design.gitlab.com/research/personas#persona-devon
New proposal
Implement a template that can be included into .gitlab-ci.yml
] and use extends
to explicitly import serverless jobs.
include:
template: Serverless.gitlab-ci.yml
serverless-build:
extends: .serverless-build
serverless-deploy:
extends: .serverless-deploy
What does success look like, and how can we measure that?
Increased usage of the serverless feature, measured by increased deployments of knative app.
Old Proposal
Treat projects as "serverless" as long as:= the following conditions are met:
- There's a
serverless.yml
file defined in the repository. - If a k8s cluster with Knative installed exists
If both conditions are met, automatically carry out the build process with the current approach.