REST エンドポイントを呼び出すために、gitblit にポスト コミット フック (Groovy スクリプト) があります。このスクリプトでは、curl コマンドを実行しています。しかし、それは失敗するようです。コマンドラインから実行すると、curl コマンドは正常に機能します。
以下は私のグルーヴィーなスクリプトです。
#!/usr/bin/env groovy
def repoUrl= "https://gitblit.myhost.com/git/" + repository + ".git"
json='{"repository":{"url":"'+repoUrl+'"}}'
def response = "curl -v -k -X POST -H \"Content-Type: application/json\" -d '${json}' https://username:password@anotherhost.com:9443/restendpoint".execute().text
println response
リポジトリは gitblit によってこのスクリプトに渡され、私はそれを確認しました。
誰かがこれを手伝ってくれますか。