Control Jenkins tasks with Siri shortcuts voice

Source: Internet
Author: User


Control Jenkins tasks with Siri shortcuts voiceShortcutsSiri shortcuts


The new version of IOS12 hides an important feature that allows Siri to be greatly expanded by using the shortcut (shortcuts), which makes it easy for users to build their own automated streams through shortcuts.
Our company to start every afternoon before the demo will be starting Jenkins to build this day's code submission firmware, each time to open the page and then click Very annoying, so I would like to give Siri a voice command,
The background lets jeninks automatically perform the build.


Premise


Here we use Siri shortcuts's Web API to remotely invoke Jenkins's web interface to complete.


First Jenkins Configuration
    1. to allow Jenkins to be remotely invoked through the API, you need to open the remote call interface for each task. You first log on to Jenkins and click on the selected task to go to the Task item page, select "Configure" on the left to go to the Task Configuration screen, under "Build Trigger" tick "trigger remote Build", then enter "authentication token", such as 1234. Then save the configuration.
    2. in order for cross-site access to Jenkins to turn off the cross-site access check for Jenkins, you can go to the Jenkins home page, select "System Management", and then select "Configure Global Security" To remove the selected " Prevent cross-site request forgery ".
    3. then go back to the Jenkins home page, click the current user name in the upper right corner to enter the user interface, select "Configure" to view "API Token", such as user ID:AAA API Token:e55e602720442a31fa1dccf3bbb4dbee
    4. can access Http://<user_id>:<api_token>@<jenkins_url>/job/<job_name>/build via curl or browser ?token=<job_token> test can trigger the build, according to our above configuration access example is as follows
    1. Curl-x POST Http://aaa:[email protected]<jenkins_url>/job/<job_name>/build?token=1234
Configuration of Siri shortcuts


First, search for shortcuts in the App Store and install it. Shortcut shortcuts to automate a lot of things by providing some action ction, such as getting a dictionary, visiting a webpage, etc., and being able to perform these actions by asking Siri. Here we mainly use the action action that automatically accesses the Web API.




Reference


Jenkins API Integration:trigger Job remotely via Jenkins API
Error 403 No Valid crumb is included in the request solution
Shortcuts User Guide



2018-9-30- [email protected]



Control Jenkins tasks with Siri shortcuts voice


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.