Drone

Trigger build command line not works

Hello

I use last version of drone

I try to trigger build by using this command line :

POST /api/repos/{namespace}/{name}/builds
POST /api/repos/{namespace}/{name}/builds?branch={branch}
POST /api/repos/{namespace}/{name}/builds?branch={branch}&commit={commit}

But it’s not works

me@laptop  ~  curl -H “Authorization: Bearer ABC” -X POST “https://app/api/repos/mycompany/messaging/builds?branch=master
null

It return null and not trigger build

But this command line works :

me@laptop  ~  curl -H “Authorization: Bearer ABC” -X GET “https://app/api/repos/mycompany/messaging/
{“id”:54,“uid”:"{ccdc8108-4e32-41e7-8bd7-dc3322e44278}",“user_id”:4,“namespace”:"…}

Have you an idea

it’s not tested feature ?

I’m able to use this feature just fine with POST https://cloud.drone.io/api/repos/{namespace}/{repo}/builds

Judging by your address https://app maybe you’re calling this from inside a docker container where app does not resolve? And is HTTPS correct here? Perhaps if you are in a docker network it should be HTTP and have a port?

Edit: My bad, you’re showing a GET that works as expected. What is the HTTP status code you’re getting?

of course we tested this feature feature launching. Here is the command I just ran locally, which launched the build as expected:

$ curl -X POST -i http://localhost:8080/api/repos/octocat/hello-world/builds -H "Authorization: Bearer xxx"

HTTP/1.1 200 OK
Cache-Control: no-cache, no-store, must-revalidate, private, max-age=0
Content-Type: application/json
Expires: Wed, 31 Dec 1969 16:00:00 PST
Pragma: no-cache
Vary: Origin
X-Accel-Expires: 0
Date: Fri, 20 Sep 2019 23:56:00 GMT
Content-Length: 706

{
    "id": 1,
    "repo_id": 106,
    "trigger": "bradrydzewski",
    "number": 1,
    "status": "pending",
    "event": "push",
    "action": "",
    "timestamp": 0,
    "message": "Update .drone.yml",
    "before": "78111cafa84f812f66c1959808e02b1dad1ae9df",
    "after": "78111cafa84f812f66c1959808e02b1dad1ae9df",
    "ref": "refs/heads/master",
    "source_repo": "",
    "source": "master",
    "target": "master",
    "started": 0,
    "finished": 0,
    "created": 1569023760,
    "updated": 1569023760,
    "version": 1
}

have you enabled debug logging and looked at your server logs to see why the build may not have been executed? the system always writes debug logs to indicate why a build was skipped, such as a missing or invalid yaml or [ci skip] in the commit message …