cuichongyang 2016-05-08 07:42 采纳率: 0%
浏览 1551
已结题

gitlab:当触发“Build Events”,webhooks发送的json数据格式

我自己用.net写了一个webapi,专门用来接收gitlab webhooks触发“Build Events”所发过来的json数据,但是想要接受此json数据,首先要在.net中建立一个跟json数据格式一样的对象,否则无法接受到数据,并且还会出错。
在gitlab的help中我也查过,“Build Events”应该是最近的版本才加进来的,现在我用的gitlab就是最新的版本,但是“help”并没有更新,也就是说“help”还是旧版本的东西,并没有关于“Build Events”的介绍,但是现在我需要用到“Build Events”这个功能,所以迫切想要知道“Build Events”被触发时的json数据格式。

  • 写回答

1条回答 默认 最新

  • 夜深未眠 2018-12-29 08:46
    关注

    {
    "object_kind": "build",
    "ref": "gitlab-script-trigger",
    "tag": false,
    "before_sha": "2293ada6b400935a1378653304eaf6221e0fdb8f",
    "sha": "2293ada6b400935a1378653304eaf6221e0fdb8f",
    "build_id": 1977,
    "build_name": "test",
    "build_stage": "test",
    "build_status": "created",
    "build_started_at": null,
    "build_finished_at": null,
    "build_duration": null,
    "build_allow_failure": false,
    "project_id": 380,
    "project_name": "gitlab-org/gitlab-test",
    "user": {
    "id": 3,
    "name": "User",
    "email": "user@gitlab.com"
    },
    "commit": {
    "id": 2366,
    "sha": "2293ada6b400935a1378653304eaf6221e0fdb8f",
    "message": "test\n",
    "author_name": "User",
    "author_email": "user@gitlab.com",
    "status": "created",
    "duration": null,
    "started_at": null,
    "finished_at": null
    },
    "repository": {
    "name": "gitlab_test",
    "git_ssh_url": "git@192.168.64.1:gitlab-org/gitlab-test.git",
    "description": "Atque in sunt eos similique dolores voluptatem.",
    "homepage": "http://192.168.64.1:3005/gitlab-org/gitlab-test",
    "git_ssh_url": "git@192.168.64.1:gitlab-org/gitlab-test.git",
    "git_http_url": "http://192.168.64.1:3005/gitlab-org/gitlab-test.git",
    "visibility_level": 20
    }
    }

    评论

报告相同问题?

悬赏问题

  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题