Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger build for Branch, Commit #2679

Closed
bradrydzewski opened this issue Apr 19, 2019 · 7 comments
Closed

Trigger build for Branch, Commit #2679

bradrydzewski opened this issue Apr 19, 2019 · 7 comments
Milestone

Comments

@bradrydzewski
Copy link

bradrydzewski commented Apr 19, 2019

Currently the only way to programmatically trigger a build is by re-starting an existing build with a new build number via the API. With 1.0 we now have the ability to fetch command branch data from version control, which means we can trigger a new build without any pre-existing data.

I propose adding the following endpoints:

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

You can pass additional parameters to your pipeline as url query parameters:

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

Note that if no branch is provided, the default branch (master) is used.

@rvora
Copy link

rvora commented Apr 24, 2019

Will there be a UI conterpart Build button (like Restart button). You'll need a way to specify / select branch as well as an optional commit.

@bradrydzewski
Copy link
Author

For this first iteration it will be available via the API and the CLI. There is a separate effort to add a branch summary screen to the user interface, at which point we will add a button to launch a build for a particular branch. I do not have a timeline for the UI, which is a separate team. Once I have more details I can post an update to this thread.

@ihakimi
Copy link

ihakimi commented May 2, 2019

@bradrydzewski does this feature already enabled on v1.1.0? I saw the PR merged on this version but when I send api with builds nothing happened,

@bradrydzewski
Copy link
Author

bradrydzewski commented May 2, 2019

@iamjarvo nope it is not part of any release yet. You would have to use master / latest until 1.2 is available. Also just a side note that you can often check on features and corresponding versions here https://github.com/drone/drone/blob/master/CHANGELOG.md 🙂

@ihakimi
Copy link

ihakimi commented May 5, 2019

thanks @bradrydzewski
Just wanted u know its the best ci/cd tool I have ever used!

@ihakimi
Copy link

ihakimi commented May 13, 2019

@bradrydzewski , when is going to be support for params for /builds

		for key, value := range r.URL.Query() {
			if key == "access_token" {
				continue
			}
			if key == "target" {
				continue
			}
			if len(value) == 0 {
				continue
			}
			hook.Params[key] = value[0]
		}

I saw in promote its enable

@ViRb3
Copy link

ViRb3 commented Oct 1, 2019

I couldn't find an active GitHub repo for the docs, but these endpoints are missing from the official docs:
https://readme.drone.io/api/endpoints/builds/

@harness harness locked and limited conversation to collaborators Nov 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants