Comments (9)
Hi @PramodKumarYadav, thank you for the suggestion! The main goal of the docs is to support collaborative contributions to the design process. For the actual and relevant information you could check the Azure Devops Docs, speaking about the pipeline resources, you could check detailed
documentation here. We'll also change the example for the file we will have enough capacity, but we also very welcome any PRs to make the documentation in the repository more helpful.
from azure-pipelines-yaml.
Thanks for the response Dmitrii.
We'll also change the example for the file we will have enough capacity, but we also very welcome any PRs to make the documentation in the repository more helpful.
On your above suggestion I would have made a PR but its not clear to me how & what values for these fields should be based on an upstream jobs pipeline. I went through the docs more than a few times and tried some combinations but all of them resulted in error saying "Pipeline Resource trigger-tests-on-merge-to-main Input Must be Valid."
Now it could be because of some simple thing missing and I tried a lot of trial and error combinations but since there is no one-to-one reference on the values to be filled in downstream job vs upstream job pipeline source, its not clear to me what is getting missed here and why it is not working. If you can help give me an example and if it works, I will be glad to create a PR to update the docs.
Thanks again for looking into it and appreciate your support on this ๐
from azure-pipelines-yaml.
@PramodKumarYadav Sure, If I understood you correctly, you want to run one pipeline from another, you can check this detailed example as a reference. If you already saw it, could you please write in detail what you want to do, maybe I could help you with it?
btw, maybe the problem is that you need to put branch
into the trigger input as in the example
# app-ci YAML pipeline
resources:
pipelines:
- pipeline: securitylib
source: security-lib-ci
trigger:
branches:
include:
- releases/*
exclude:
- releases/old*
from azure-pipelines-yaml.
Hello @DmitriiBobreshev , my use case is to use option number 5 (Pipeline completion triggers) here:
I have a "test repository" which contains a pipeline that can run tests. What I want is when an "application" repository pipeline finishes (say for deployment), then I can immediately run my tests in the "test" repository post the application pipeline completion.
btw, maybe the problem is that you need to put branch into the trigger input as in the example
P.S: I did include branch name in the pipeline I setup but it didnt work. So maybe a working example that shows how the downsteam (test) repo should refer to resource names in an upstream (app) repo that would be great!
from azure-pipelines-yaml.
@PramodKumarYadav, Have you tried to enable build completion triggers using GUI?
In the "application's" pipeline, you need to select triggers
and set your"test repository's" pipeline
here you can find the description: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/pipeline-triggers?view=azure-devops
from azure-pipelines-yaml.
@DmitriiBobreshev : Classic build triggers are not allowed in our company. So I have to use pipeline triggers and I keep getting this error.
on-internal-trigger.yml (Line: 7, Col: 15): Pipeline Resource securitylib Input Must be Valid.
even when I use exactly the same trigger example as specified here: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/pipeline-triggers?view=azure-devops
P.S: This has been so much more simpler to setup when I worked with Github Actions. I wish it wasn't so difficult here :). Maybe an example public test repo that shows all these pipelines working examples would be great.
Step1:
Pipeline to run first: security-lib-ci.yml file
Result: pipeline succeds
# security-lib-ci YAML pipeline
steps:
- bash: echo "The security-lib-ci pipeline runs first"
Step2:
Pipeline to run second: on-internal-trigger.yml
Result: fails with error on-internal-trigger.yml (Line: 7, Col: 15): Pipeline Resource securitylib Input Must be Valid.
# app-ci YAML pipeline
# We are setting up a pipeline resource that references the security-lib-ci
# pipeline and setting up a pipeline completion trigger so that our app-ci
# pipeline runs when a run of the security-lib-ci pipeline completes
resources:
pipelines:
- pipeline: securitylib # Name of the pipeline resource.
source: security-lib-ci # The name of the pipeline referenced by this pipeline resource.
# project: app # Required only if the source pipeline is in another project
trigger: true # Run app-ci pipeline when any run of security-lib-ci completes
steps:
- bash: echo "app-ci runs after security-lib-ci completes"
Location of files (both in root repository)
from azure-pipelines-yaml.
Okay, I finally got to make it work but it seems the documentation here would need some updating if others dont go through the same issues.
In short the name of pipeline is not the nae of the file but the name of pipeline as seen in the GUI.
source: security-lib-ci # The name of the pipeline referenced by this pipeline resource.
So for example the name of the first pipeline to finish is:
- main-ci-trigger (custom name given by the user or name of the project by default) if its the only pipeline or with a number after project name if not renamed.
![Screenshot 2023-06-12 at 22 14 45](https://private-user-images.githubusercontent.com/11694972/245264090-e88e62dd-f941-4408-a676-b2fc9f1ed533.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk3Nzg0NzMsIm5iZiI6MTcxOTc3ODE3MywicGF0aCI6Ii8xMTY5NDk3Mi8yNDUyNjQwOTAtZTg4ZTYyZGQtZjk0MS00NDA4LWE2NzYtYjJmYzlmMWVkNTMzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MzAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjMwVDIwMDkzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM4MjBjZjBhN2ExM2RjYWFhNTZiODUyYmRkYTBjZmIxZDQyNDcwMmExYWZkZWQxNGUwNzk2OWY0ZTIxNTIzODYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.IVgtykXnmp7L1-H7HJPEc0WL9HTgdfDL_oX2jgy_FXg)
Now this again is not enough. After user add the correct pipeline name in the source, they would also need to add a pipeline via GUI for these secondary pipeline triggers. Unless we do that the the yaml files in themselves are not enough to trigger the runs (something which works automatically in tools like github action). So unless you add this instruction also in the read me file, it would not work.
As a last step, If this trigger should really run "after" the first pipeline is finished then we need to add a trigger: none on the top so that our second pipeline only run one time "after" the first pipeline is finished. If we dont add this our pipeline will run two times. First in parallel to the first line and then again after first pipeline is finished.
P.S: If you could ping me the location to update documentation, I will be more than happy to create a PR with detailed instructions on how to do this properly. Hopefully no other user has to face this issue again ever.
from azure-pipelines-yaml.
My bad. I see this is the repo where all the documentation is :). I will create a PR right away with detailed examples.
Edit: Spoken too soon. I dont see the files for this page in this repo: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/pipeline-triggers?view=azure-devops
If you could ping me the repo where this documentation is updated, I will clone and create a PR there.
from azure-pipelines-yaml.
Hi @PramodKumarYadav, I'm glad that it finally working! The documentation for ms learn is placed here. You could open most of the ms learn sources by pressing the button
from azure-pipelines-yaml.
Related Issues (20)
- by design thereยดs not available option in DeVops Service to create a new pipeline yaml for "existing" branch HOT 5
- deploy built artifacts in container uploads both checked out projects instead of right one HOT 2
- how to triger a build pipeline from powershell HOT 2
- Pipeline resource trigger documentation missing prerequisite HOT 1
- could find the branch error in azure yaml HOT 2
- python task ran successfull but pipeline is faiing with bash exit code 1 HOT 3
- Azure YAML Pipelines - Using template expression variables at non-global scope HOT 1
- Hi Team While running my Azure pipeline.yaml I am getting following error: directive are not supported for the expression that are embedded within the string Directive are only supported when the entire value is an expression HOT 1
- This repo is missing important files
- It is possible to convert a json to variables/parameters YAML and iterate? HOT 3
- Support for conditions in templates? HOT 1
- Custom expression/function in Yaml HOT 1
- Azure DevOps YAML Template Powershell script file issue HOT 2
- Azure Pipelines Resource Trigger (branch filter) not working as expected. HOT 2
- GitHub Actions Build Error: Invalid App Path for Django-Celery-Beat Dockerfile HOT 3
- Error running pipeline after renaming default GitHub branch from 'master' to 'main' HOT 3
- Publishing artifacts from a failed step HOT 1
- Pass variables from Build pipeline to Release HOT 2
- Error signing debug variant bundle android app using YAML file HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-pipelines-yaml.