Add environments and deployments
This MR is a continuation of https://gitlab.com/gitlab-org/gitlab-ce/issues/17009.
The current implementation is as follow:
- We have two new tables:
environments
anddeployments
. - We have a new tab:
Environments
underPipelines
where you can see all you environments and add a new one. - We add a new option to
.gitlab-ci.yml
to track where we should create a deployment for environment. - If environment in
.gitlab-ci.yml
is specified it will create a deployment. If environment does not exist it will be created. (this got changed) - The deployment is always successful and shows the time of the action, in that case a build that presumably should do deployment. In the future we could extend deployment with statuses: success, failure. We could extend deployments with information that this is partial or full deployment.
- User have to create environments that he will track first.
- User can remove environments.
- User can retry/rollback past deployment (in that case we retry past build). The new build when succeeds it will create a new deployment.
- Currently environment have only one parameter:
name
. In the future it should have:variables
,credentials
and possiblyrunners
and maybe other resources. - Currently deployment have this parameters:
sha
,ref
,deployable (in this case a build)
,user (who triggered a deployment)
,created_at
.
The .gitlab-ci.yml
:
deploy to production:
stage: deploy
script: dpl travis...
environment: production
What needs to be done:
-
Write initial implementation -
Improve implementation (@ayufan) -
Write tests (@ayufan) -
Improve UX of the forms (cc @markpundsack) - reviewed by @markpundsack -
Improve implementation of the views (cc @jschatz1) - done by @iamphill -
Write .gitlab-ci.yml documentation for environments
- done by @ayufan -
Write user documentation (@ayufan and @markpundsack)