Is there a way to add a Docker Webhook programmatically? - docker

say I set up OAuth.. I can use that access with the Registry API to do registry stuff.. what I want is for people to be able to set up automated builds and then when that is done a webhook automatically sets off a deployment on my server.
I would like to automatically create this Webhook. Is there an API to do that? Thanks.
See https://docs.docker.com/userguide/dockerrepos/#webhooks

Related

Can you update the Twilio Flex Agent image via plugin

We are using SSO to set up users for Flex. However, I can not work out how to pull in the user's avatar from Azure.
The only way I can think without having the images public is to create a plugin to set the image from the graph API but I'm not sure how you can set it.
Ideally the plugin should only run on login I guess.

How to trigger Jenkin Jobs from Microsoft Team Channel?

I am looking to trigger Jenkins's job from the Microsoft team's channel. Can anyone provide step by step implementation of this?
There are two nice options you can use:
Outgoing Webhook - Will scan for words in the chats and send a notification to your Jenkins server.
Commander - Second and more customizable option is using the Commander add on for teams, which in addition to builtin commands provides the ability to Create your own Custom Commands.
With both options you will be able to tigger Jenkins jobs via the Remote Access API, see the This Question for additional info on remote execution.

How can I trigger jenkins jobs with a slack bot?

I have Jenkins running on one of the VMs on GCP. I have a bunch of jobs and I want to give my team access to run them from Slack. They haven't used Jenkins earlier, and not at all familiar with the UI. So, they want to run it from Slack. We already have a slack bot. So, here are my following questions:
Can I integrate our existing slackbot with jenkins, so that it can trigger the jobs? If yes, how can I do it? (any tutorial would be greatly appreciated)
I know there is a way to do this with slash commands. But I don't want run a different command for each job, it's actually not really clean. Cause if I have 20 jobs, I have to create tokens for all of them, and configure 20 slash commands.
What are the other ways of triggering Jenkins jobs from Slack?
PS: I'm looking for something like #bot run "job" "parameter" or #bot run "job". And it would be great if the bot can tag the user and respond to a request
you have to create a slack app for this and enable events and interactivity.
https://api.slack.com/apis/connections/events-api#the-events-api__subscribing-to-event-types__events-api-request-urls__request-url-configuration--verification__url-verification-handshake

What is the best way to generate events from Jenkins?

I have a series of jenkins pipeline jobs to move Apps to Cloud Foundry. My client application need to be able to listen to all the updates of a push. I.e. apart from getting text logs, i need other events like Git repo cloned, cloud foundry logged in, App pushed.
One crud way of doing this is to submit POST requests to an event server from a shell script(Curl). However, I think it is unlikely that such a functionality does not exist already on Jenkins(either through a plugin or something like that).
I need an advice from best practices point of view.
Thanks.
As commented by mdabdullah. But this needs a person to set up kibana or splunk. (I did not try this).
Statistics gatherer plugin
https://plugins.jenkins.io/statistics-gatherer/
Jenkins notification plugin
https://plugins.jenkins.io/notification/
Both 2,3 are available plugins in the Jenkins community. They need to configured for server endpoints before use.

Trigger Jenkins Pipeline when new file gets added to blob storage

I've an Azure blob storage bucket with some video files.I need to trigger a Jenkins Pipeline whenever a file gets added to the bucket. I was thinking I could have a microservice in the Azure Functions to monitor the bucket and trigger Jenkins but it would be great if I could do this directly without an additional microservice.
Is there a way I can get Jenkins to trigger a pipeline based on my bucket? A plugin or a script or something?
PS: I found this question, but I'm looking for something different.
You could trigger a build without parameters by setting up an event subscription on your storage account to call your Jenkins build endpoint. Since your build won't have parameters, your script would have to keep track of the blobs processed (assuming they are not deleted once processed).
But if you need build parameters then you would have to transform the payload coming from the blob event before calling the Jenkins API.
Though you mentioned that you wouldn't want to include another service for this, sharing options just in case, in increasing order of complexity
If you have your Jenkins API behind an API Gateway, like Azure APIM, you could transform the body before forwarding the request to Jenkins.
Use a simple Logic App to trigger on the event and then call the Jenkins API, passing the parameters extracted from the event as required
Similar to what is mentioned in the other question you linked, Azure Functions.
If you don't have APIM (or something similar), Logic Apps are a great solution considering the use case with almost no-code to write.

Resources