gitlab-org--gitlab-foss/lib/api
Rémy Coutable be09845914 Merge branch 'environments-and-deployments' into 'master'
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:
1. We have two new tables: `environments` and `deployments`.
2. We have a new tab: `Environments` under `Pipelines` where you can see all you environments and add a new one.
3. We add a new option to `.gitlab-ci.yml` to track where we should create a deployment for environment.
4. 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)
5. 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.
6. User have to create environments that he will track first.
7. User can remove environments.
8. User can retry/rollback past deployment (in that case we retry past build). The new build when succeeds it will create a new deployment.
9. Currently environment have only one parameter: `name`. In the future it should have: `variables`, `credentials` and possibly `runners` and maybe other resources.
10. 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:
- [x] Write initial implementation
- [x] Improve implementation (@ayufan)
- [x] Write tests (@ayufan)
- [x] Improve UX of the forms (cc @markpundsack) - reviewed by @markpundsack
- [x] Improve implementation of the views (cc @jschatz1) - done by @iamphill 
- [x] Write .gitlab-ci.yml documentation for `environments` - done by @ayufan
- [ ] Write user documentation (@ayufan and @markpundsack)

See merge request !4605
2016-06-15 13:48:09 +00:00
..
api.rb Revert "Added API endpoint for Sidekiq Metrics" 2016-06-14 16:46:53 +00:00
api_guard.rb Fix a few places where autoloading would fail 2016-05-10 11:51:19 +02:00
branches.rb Changed the argument of not_found for 'unprotect' 2016-04-06 15:07:31 +05:30
builds.rb Merge remote-tracking branch 'origin/master' into environments-and-deployments 2016-06-14 16:19:29 +02:00
commit_statuses.rb Rename all ci_commit[s] in application code to pipeline[s] 2016-06-03 16:27:50 +02:00
commits.rb Extract LegacyDiffNote out of Note 2016-05-13 17:31:43 -05:00
deploy_keys.rb Fix failing tests due to updates on the return messages. 2015-01-07 11:39:20 +01:00
entities.rb UI and copywriting improvements 2016-06-14 13:18:14 +02:00
files.rb WIP lazy blobs 2016-02-01 10:41:52 +01:00
gitignores.rb Dropdown implementation 2016-05-20 15:58:36 -05:00
group_members.rb Track who created a group or project member. 2015-04-14 12:06:42 +02:00
groups.rb Fix groups API to list only user's accessible projects 2016-05-24 18:14:12 -07:00
helpers.rb Fix Error 500 when using closes_issues API with an external issue tracker 2016-06-11 19:50:08 -07:00
internal.rb Fix setting of "action" for Grape transactions 2016-04-20 22:42:52 +02:00
issues.rb Fix pseudo n+1 queries with Note and Note Authors in issuables APIs 2016-06-08 10:26:05 -04:00
keys.rb Add API method for get user by ID of an SSH key 2015-09-03 15:47:22 +03:00
labels.rb Add API endpoints for un/subscribing from/to a label 2016-05-12 22:48:09 +02:00
licenses.rb Enable Style/IndentAssignment Rubocop style cop 2016-05-30 10:45:10 +02:00
merge_requests.rb Fix Error 500 when using closes_issues API with an external issue tracker 2016-06-11 19:50:08 -07:00
milestones.rb Filter confidential issues from milestones API if user does not have access 2016-04-25 12:20:29 +02:00
namespaces.rb Make namespace API available to all users 2015-05-28 11:39:12 -07:00
notes.rb Move note helper method to notes entity file 2016-05-17 21:41:53 -05:00
project_hooks.rb Prevent users from deleting Webhooks via API they do not own 2016-04-24 23:53:59 -07:00
project_members.rb Add request access for groups 2016-06-14 13:07:26 +02:00
project_snippets.rb Prevent private snippets in public/internal projects from being leaked via API 2016-04-25 12:02:06 -07:00
projects.rb Merge remote-tracking branch 'origin/master' into docker-registry 2016-05-13 17:14:46 -05:00
repositories.rb Add workhorse controller and API helpers 2016-06-06 13:16:30 +02:00
runners.rb Extend runner options that are configurable via API 2016-05-19 22:01:53 +02:00
services.rb Hide passwords to non-admin users in the services API 2015-10-12 15:24:00 +02:00
session.rb Improve Gitlab::Auth method names 2016-06-10 14:51:16 +02:00
settings.rb Add tests and improve logic 2015-07-06 16:47:19 +02:00
subscriptions.rb Add API endpoints for un/subscribing from/to a label 2016-05-12 22:48:09 +02:00
system_hooks.rb Added X-GitLab-Event header for web hooks 2015-05-08 16:49:03 +03:00
tags.rb API: Present an array of Gitlab::Git::Tag instead of array of rugged tags 2016-04-17 11:03:10 +02:00
triggers.rb Make the CI permission model simpler 2016-02-02 09:18:08 +01:00
users.rb Enable Style/RedundantParentheses rubocop cop 2016-05-30 15:07:18 +02:00
variables.rb Make the CI permission model simpler 2016-02-02 09:18:08 +01:00