Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Trigger using HTTP request #55

Open
gsantner opened this issue Jun 9, 2018 · 4 comments
Open

Trigger using HTTP request #55

gsantner opened this issue Jun 9, 2018 · 4 comments
Assignees

Comments

@gsantner
Copy link
Contributor

gsantner commented Jun 9, 2018

Currently flux ci misses support for triggering using HTTP requests (not using Git service - but manually e.g. using curl)

Here are two examples I know, and would be great if we are mostly compatible:

  • GitLab: curl --request POST "https://<IP_DOMAIN>/api/v4/projects/<PROJECT>/trigger/pipeline?token=<TOKEN_FROM_PROJECT_SETTING>&ref=<BRANCH_COMMIT_OR_TAG>&variables[build_docs]=1&variables[deployment_env]=testing&variables[sdk_version]=2.16" (Basic docs)
  • Jenkins: curl "https://<IP_DOMAIN>/job/<PROJECT>/buildWithParameters?token=<TOKEN_FROM_PROJECT_SETTING>&ref=<BRANCH>&build_docs=1&deployment_env=testing&sdk_version=4.1-beta

The goal would be to basically support those two styles of passing vars.

  • With ref and token always being special use for us in ci
  • All other vars as environment variable - with variable setting variable[something]=value working the same as something=value would have been specified

Thought: maybe something like https://mylux.ci/api/trigger/FLUXCI_USER/FLUXCI_PROJECT/pipeline?token=something ?

Return body could be json with ok/success flag and new pipeline-id.

This is specially getting interesting when one wants to trigger e.g. a release build for an application, but wants to specify some values.

I'm have not worked with any rest framework in python yet. maybe this is not too hard, dont know.

@NiklasRosenstein
Copy link
Owner

I do understand correctly that this would be basically the same as starting a new build via the Web Interface, only that you can specify some environment variables as well?

We should also get the ability to specify environment variables with the "New Build" option in the web as well.

@gsantner
Copy link
Contributor Author

gsantner commented Jun 9, 2018

Yes, exactly.
If user has the ability too on webui even better. Than we could already call API with given parameters instead of calling python methods.

The other thing - At ci-file level I have already implemented support for parsing things from file, but those are thought to be more or less fixed values you dont change often :D.

@NiklasRosenstein NiklasRosenstein self-assigned this Jun 9, 2018
@gsantner
Copy link
Contributor Author

gsantner commented Jun 9, 2018

I can give some ideas or feedback from what I know of GL and jenkins CI 's trigger API and Web-Trigger-View if something needed

@gsantner
Copy link
Contributor Author

gsantner commented Jun 9, 2018

related to decisions of #49 too

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants