-
Notifications
You must be signed in to change notification settings - Fork 200
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
run_pipeline discards needed parameters #331
Comments
I was trying to pass the variables to the run_pipeline function to trigger the pipeline running with specific variables, but failed, any idea for this?
|
If I'm reading the what the package is doing correctly, you probably want something more like: def run_pipe(project, pipe_id):
run_params = {
'variables': {
'var_test': 'abc'
}
}
pipeline_client = self.connection.clients_v6_0.get_pipelines_client()
pipeline_client.run_pipeline(project=project, pipeline_id=pipe_id, run_parameters=run_params) But, having dealt with queuing builds/pipelines, you may need the run_params to look like: def run_pipe(project, pipe_id):
run_params = {
'variables': '{"var_test": "abc"}'
}
pipeline_client = self.connection.clients_v6_0.get_pipelines_client()
pipeline_client.run_pipeline(project=project, pipeline_id=pipe_id, run_parameters=run_params) I'd try the first and see if it works, if not try the second. All the builds I'm playing with currently require templateParameters, so I can't do a quick test. May be able to take some time and set up a test build this weekend and see which way works. |
Тhis works properly for API Version 6.0-preview.1: def run_pipe(project, pipe_id):
run_params = {
'variables': {
'var_test':
{
'isSecret': 'false',
'value': 'abc'
}
}
}
pipeline_client = self.connection.clients_v6_0.get_pipelines_client()
pipeline_client.run_pipeline(project=project, pipeline_id=pipe_id, run_parameters=run_params)
|
I think this can be closed as templateParameters are now supported, i.e. templateParameters={"deployTo": "test"},
run_params = {
"templateParameters": templateParameters,
"resources": {
"repositories": {"self": {"refName": f"refs/heads/{branch_name}"}}
},
} using |
Hi, Could you please provide an example? Thanks in advance |
Looks like this was fixed with PR #355 quite some time ago. I'll try it tomorrow and verify that it now supports both template params and variables correctly and post an example and close this issue. |
is there way to set branch?? cant find document of those parm setting |
a way to checkout a specific commit is:
|
azure-devops/azure/devops/v6_0/pipelines/pipelines_client.py takes the parameter
run_parameters
and then sets the variable content viaIn doing so it discards templateParameters (along with previewRun, stagesToSkip, and yamlOverride), but my concern is with templateParameters.
If I'm tracing things correctly, the problem is in the class RunPipelineParameters in azure-devops/azure/devops/v6_0/pipelines/models.py which only maps resources and variables:
The text was updated successfully, but these errors were encountered: