问题是关于新的heroku API结构:
"接受":"应用/ vnd.heroku + JSON;版本= 3"
如果我要求发布数据,我会得到那个:
{
"app":{"id":"b3d70761-ee7f-4039-91ac-402d2f9d12b6","name":"some-name"},
"created_at":"2015-03-22T07:33:18Z",
"description":"Set COMMIT_HASH config vars",
"id":"610f896a-3f34-44af-b39a-43070f02891f",
"slug":{"id":"2e8e024d-4ffa-44ff-8da9-5accd3874a5e"},"updated_at":"2015-03-22T07:33:18Z",
"user":{"email":"tmp@mail.com","id":"7d46e391-63ca-4b19-b4e4-96fec8487f77"},
"version":507
}
这里唯一的问题是没有 git commit hash,它确实存在于旧的中 结构体。看起来像这样:
"addons": [
"newrelic:stark",
"rediscloud:100",
"redistogo:nano",
"deployhooks:http"
],
"commit": "9a627af", <<===
"created_at": "2015/03/18 11:52:58 -0700",
"descr": "Deploy 9a627af",
"env": {
},
"name": "v461",
"pstable": {
"web": "java -Dkeyvalue.datasource=redis $JAVA_OPTS -jar build/libs/some.jar --server.port=$PORT"
},
"user": "tmp@tmp.com"
所以现在我必须使用这两种结构 并最终2个版本的相同api: 任何替代方案的想法?
提前致谢 罗马
答案 0 :(得分:0)
我相信API现在会返回一个版本的Slug,你可以查找该提交的Slug。
https://devcenter.heroku.com/articles/platform-api-reference#slug