How do I trigger a build from git repo?

82 views
Skip to first unread message

stav alfi

unread,
Oct 28, 2020, 8:14:00 PM10/28/20
to quay-sig
I want to use the REST API to trigger a new build (https://quay.io/api/v1/repository/stavalfi/build-poc3/build/) but im not sure where to specify the github repo and the github_token (the git repo is private)



---

also, is there a way to register to events (in web-sockets or something similar) for changes in build-status?

dgan...@redhat.com

unread,
Oct 28, 2020, 8:50:22 PM10/28/20
to quay-sig
Hi,

  Login to your github and Quay.io in same browser , then navigate to quay.io--> repository --> builds --> Create build trigger -->  Github repository push -->  the quay.io will now list the github org, select the organization which contains your  github private repository and fill out the rest of the details and continue.A new public ssh key will be automatically added to your github repo.

For getting notified for various events navigate to repository inside Quay.io --> settings --> Create notification --> select the type of event you want to be notified for and select the notification method aswell and save the same.

Thanks,
Dixit

Alec Merdler

unread,
Oct 29, 2020, 1:57:48 AM10/29/20
to quay-sig
Hi, the API endpoint you are using is actually somewhat intended to be used internally to quay.io, as it refers to an internal Dockerfile upload when using the UI. 

I think the API endpoint you are actually looking for is to start a build using an existing build trigger (with a trigger created from the web UI described above). The GitHub repository and token would be provided when setting up the trigger via the web UI. What you need to supply is the branch and git SHA to use as a point of reference for the version of the source code to use.
POST /api/v1/repository/{repository}/build/
{
  "branch_name": "string",
  "commit_sha": "string"
}

Let us know if that helps!

Ivan Bazulic

unread,
Oct 29, 2020, 3:03:12 AM10/29/20
to Alec Merdler, quay-sig
The API endpoint https://docs.quay.io/api/swagger/#!/build/requestRepoBuild has an archive_url in its body. This represents the URL where Docker build context is publicly available. It must be in the form of a zip or tar.gz file. The dockerfile_path and context inside the JSON body are relative to the archive.

HTH!

--
You received this message because you are subscribed to the Google Groups "quay-sig" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quay-sig+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quay-sig/24a0ccb0-42f9-4956-95d7-ba71fd0774can%40googlegroups.com.


--

IVAN BAŽULIĆ

SENIOR SUPPORT ENGINEER

Red Hat EMEA

Communications House,
Cork Road,
Waterford X91 NY33

ibaz...@redhat.com    M: +385959269281     IM: ibazulic

stav alfi

unread,
Oct 29, 2020, 7:43:52 AM10/29/20
to quay-sig
hi, thanks for the response. I'm not interested in triggering the build after a push. I have my own logic and I want to control how and when the build is triggered. 

also, the body you provided is not in the swagger.

Message has been deleted

stav alfi

unread,
Oct 29, 2020, 1:50:52 PM10/29/20
to quay-sig
Hi ibaz...@redhat.com, you helped alot!
Reply all
Reply to author
Forward
0 new messages