In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of "how to create a timed build task for Jenkins". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this "how to create a timed build task for Jenkins" article can help you solve the problem.
I. Preface
Here you create a scheduled build task using Jenkins.
Create a definition task 1. Create a new task
Select New item on the Jenkins home page or click to create a new task:
Enter a task name and select a free-style task (Freestyle project):
2 、 General
On the GeneralTab page, you can enter project description information, select a custom workspace, and so on, as shown in the figure:
If you do not choose to use a custom workspace here, Jenkins will use the default workspace. I install Jenkins locally in the C:\ Program Files (x86)\ Jenkins directory, so the default workspace is C:\ Program Files (x86)\ Jenkins\ workspace.
3. Source code management
The source code management Tab page can choose the tools we use to manage the source code, such as Git and SVN. We are integrating with GitHub, so select Git in source code management:
4. Build triggers
When building a trigger, Tab can also choose which trigger to build. There are mainly the following types of triggers:
Trigger a remote build (for example, using a script): means to build using a remote tool.
Build after other projects are built: indicates that this Job will not be built until the other Job that the Job depends on has been build.
Build periodically: means that the build task is executed regularly, that is, it is build at regular intervals, regardless of whether the version library code has changed or not.
GitHub hook trigger for GITScm polling: indicates that the code on the GitHub is built when there is a change.
Poll SCM: indicates that the source code is compared at regular intervals. If there is a change, build is executed. Otherwise, build will not be carried out.
We select "Build periodically" in the build trigger to compile periodically. Here, we set it to compile every 5 minutes:
Build syntax on a regular basis:
* *
The first * sign indicates minutes and the value range is 0059.
The second * sign indicates the hour, and the value range is 0023.
The third * sign indicates the day of the month, with a value range of 1: 31.
The fourth * sign indicates the month in which the value ranges from 1 to 12.
The fifth * sign indicates the day of the week, with values ranging from 0 to 7, where 0 and 7 represent Sundays.
Build every 5 minutes
Happer 5 *
Build every two hours:
H Hap2 *
Build regularly at 12:00 noon every day
0 12 *
Note: none of these five parameters can be missing.
5. Build the environment
The build environment chooses to delete the workspace before starting the build:
6. Construction
This is used to set up the build steps. Here we choose to execute the Windows batch command:
Then enter the batch command to execute:
If Jenkins is installed on a Windows system, choose Execute Windows batch command here.
If Jenkins is installed on a Linux system, choose Execute shell here.
7. Post-build operation
This is used to configure what actions to take after the build is completed, such as automatically sending e-mail. Don't make any settings here.
After configuration, click the "Save" button to complete the configuration.
Go back to the main interface and select "Build Now" to build immediately:
Click the downward inverted triangle to select the console output:
You can see the build information in the console:
The final display of SUCCESS indicates that the build is successful.
That's all for "how to create a scheduled build task for Jenkins". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.