support gitlab environments
We are heavily using review apps for testing our applications with clients:
- https://docs.gitlab.com/ce/ci/review_apps/
This opens the request, that upon creation of an environment in platform.sh it would be genius to also create a related environment like platform.sh-MR-123 with the main URI of the platform.sh project. The same could happen for branches build.
Gitlab API:
- https://docs.gitlab.com/ce/api/environments.html
Having the gitlab API it would be possible to create the envs on the fly and also remove them if a MR is closed and an environment is shutdown ...
- https://docs.gitlab.com/ce/api/environments.html#create-a-new-environment
- https://docs.gitlab.com/ce/api/environments.html#edit-an-existing-environment
- https://docs.gitlab.com/ce/api/environments.html#stop-an-environment
It definitely needs to be cleared, what the difference between stopping and deleting an environment is in the gitlab terminology.
@pjcdawkins as I've seen that you created #665 so nicely, hopefully it's not seen as bad behaviour that i mention you here to get your attention. Thanks a lot for your efforts.
just to be clear, i found the following stuff in the gitlab doku, which would easily make it possible to create environments:
https://docs.gitlab.com/ce/api/deployments.html
---snip---
"environment": {
"external_url": "https://about.gitlab.com",
"id": 9,
"name": "pl.sh/branch"
},
---snip---
This is the interesting part of the documentation. Having that after a successfull deployment would auto create the environments and make life a lot easier.
After purging an env, the link should also disappear from the gitlab list (see env api from above)
This sounds like a good feature request IMO. The GitLab integration runs on the Platform.sh (project's) server, not in the CLI, so it's not the CLI's responsibility (and it's not something I can handle myself). I've made a internal feature request and linked to this ticket.
thanks a lot.