Server dependency

  • CentOS 7.6
  • Install Tomcat

The installationJenkins

  1. Enter theTomcatthewebappsRun the following command in the directory
wget http://mirrors.jenkins.io/war/latest/jenkins.war
Copy the code
  1. Enter theTomcatthebinRun the following command to start the Tomcat service
sh startup.sh
Copy the code
  1. Open a browser and type[Server IP address]:[Tomcat port number]/ JenkinsYou can visit the Jenkins page below
  2. Enter the password as prompted to see the plug-in installation page
  3. Directly select the button on the left to install the recommended plug-in. After installation, the user registration page will be displayed
  4. Once registered, go to Jenkins’ panel

configurationJenkins

  1. System management -> Management plug-ins -> Optional plug-ins, find the required plug-ins can be installed
  2. The following plug-ins need to be installed
  • NodeJS (since my test project is written in Node, NodeJS is installed)
  • Publish Over SSH
  1. System Administration -> Global Tool Configuration ->NodeJS
  2. System Management > System Configuration >Github
  3. System > System Configuration >Publish over SSH
  4. System Management > Node Management > Create a node

configurationGithub

  1. Open repository -> Settings -> WebHooks
  2. Github upper-right Settings->Developer Settings-> Personal Access Tokens ->Generate new Tokens

withJenkinsCreating a Task

Build tasks

  1. Click the icon to enter the task panel
  2. Click Build Now to start the Build task
  3. Click the task number to view the task details

An automated build

Since the Github push has been configured to notify Jenkins of the automatic build task, the update code push to the master branch of the repository will enable the automatic build.