问题
Previously I had created an automation job for AWS where Jenkins keeps an eye on an SQS queue using the Jenkins AWS SQS Plugin and triggers a build job when it finds a message in the queue. The queue is configured to receive notification from an S3 Bucket whenever any "create" event occurs.
I am trying to test out a similar process on Microsoft Azure platform and am a little confused as to which Azure services to use. I see that Azure Event Grid can be used or maybe we can directly post notification from Blob Storage service or maybe use Azure Service Bus ?!?
Also, I did found a Jenkins Azure Storage plugin which has a slightly different but useful functionality.
As for documentation, I found only one link that is close to how this might be done but that too seems incomplete..
Any and all help appreciated.
回答1:
You can use Azure Functions for it. Write a code that will be triggered when a new blob arrives / existing blob gets updated, then do a request to your jenkins to queue a build.
Here are useful links:
https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-storage-blob-triggered-function
https://wiki.jenkins.io/display/JENKINS/Remote+access+API
来源:https://stackoverflow.com/questions/58400293/trigger-a-jenkins-build-on-azure-blob-update