Provide more customization to AutoDevops by splitting the templates into more files
Problem to solve
Currently when trying to configure a custom CI, you can't pick out certain stages easily. For instance, if I want to only do build, test, review, but skip deploy, I can't really do that easily by referencing the template files.
Example ( I want ):
image: alpine:latest
stages:
- build
- review
- cleanup
include:
- template: Jobs/Build.gitlab-ci.yml
- template: Jobs/Deploy.gitlab-ci.yml
What I currently have to do, even though i don't need everything else:
stages:
- build
- test
- deploy # dummy stage to follow the template guidelines
- review
- staging
- canary
- production
- incremental rollout 10%
- incremental rollout 25%
- incremental rollout 50%
- incremental rollout 100%
- cleanup
Intended users
Developers
Further details
More customization for Autodevops
Proposal
Currently, we can take Deploy.gitlab-ci.yml
and split it up into smaller chunks like so:
review
stop_review (cleanup)
staging
canary
production
Deploy.gitlab-ci.yml would still be the same and look something like:
include:
- template: Jobs/Review.gitlab-ci.yml
- template: Jobs/Cleanup.gitlab-ci.yml
- template: Jobs/Staging.gitlab-ci.yml
- template: Jobs/Canary.gitlab-ci.yml
- template: Jobs/Production.gitlab-ci.yml
Basically create a new CI file for every stage of deployment. The rollout could possibly be re-worked somehow, but this would be a good start. This way you can define custom stages for a custom auto deployment. You could have something like:
image: alpine:latest
stages:
- build
- test
- production
- incremental rollout 10%
- incremental rollout 25%
- incremental rollout 50%
- incremental rollout 100%
include:
- template: Jobs/Build.gitlab-ci.yml
- template: Jobs/Test.gitlab-ci.yml
- template: Jobs/Production.gitlab-ci.yml
Until Production can be split up more, you would still need to include the incremental.
Permissions and Security
None
Documentation
Testing
Because the files are split, it may be a little more difficult to see what is dependent on what now.
What does success look like, and how can we measure that?
Please see example above. Being able to create a small auto deployment when necessary. This can be measured by tracking the include template tags and tracking who is using specific stages of the deployment process.