从管道工作中删除gitlab环境
目前,我正在为每个合并请求创建gitlab环境,以部署临时页面。合并请求后,这些环境立即停止,但是我想在管道中添加一个额外的步骤,以完全从“停止”环境中“删除环境”。我不想使用GUI,我发现的唯一选项是API方法:
delete/projection/:id/emovents/:emovention_id
https://docs.gitlab.com/ee/ee/eapi/environments.html#delete-delete-ntml#delete-an-en-en-vironment
,这里的问题是它需要:emoventing_id
变量,我无法找到并获得。
以不同的方法或如何获得:emoventim_id
的任何帮助将不胜感激。
Currently, I am creating GitLab environments for each merge request to deploy temporary pages. These environments stop as soon as merge request is merged, but I want to add an additional step to the pipeline to "Remove environment" completely from "Stopped" environments. I don't want to use GUI and only option I found was an API method:
DELETE /projects/:id/environments/:environment_id
https://docs.gitlab.com/ee/api/environments.html#delete-an-environment
But, problem here is that it required :environment_id
variable, which I couldn't manage to find and get.
Any help with a different approach or how to get :environment_id
will be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以删除时间表停止审查应用程序环境:
或者您可以列出您的环境搜索您需要使用
name
或搜索
param删除的一个。然后,您可以获取emovention_id
删除该环境。您可以添加状态
参数以获取停止的环境:然后,只需对结果进行循环即可调用
delete
endpoint。您可以使用 jq 在结果中获取emovention_id
。You can schedule for deletion all stopped review apps environment :
Or you can list your environments and search for the one you need to delete with
name
orsearch
param. Then you can get theenvironment_id
to delete that environment. You can add thestates
param to get only stopped environments :Then just make a loop on the result to call the
DELETE
endpoint. You can use jq to get theenvironment_id
in the result.