Gitee-based jenkins configuration (pull code from Gitee and build)

Prerequisites :

Build jenkins online service, install gitee plug-in, registration code cloud account, create project (you can use the project to name), install Git

step:

  • Log in to jenkins, code cloud
  • New management credentials
  • New Item (it is recommended to use the name of the item to name)
  • Specific task configuration
  • Build verification

1. Log in to Jenkins and Code Cloud

Insert picture description here

Insert picture description here

Note: Gitee must make sure that there are codes that need to be pulled above

2. Create new management credentials

Jenkins Homepage—Settings—Manage Credentials—Global Credentials

Insert picture description here

Click to add credentials

Insert picture description here

Enter Gitee account, password ID can be filled in arbitrarily, the description box can be written according to the project
Insert picture description here

Type item must be selected

Insert picture description here

3. Create a new item (it is recommended to name the item)

Jenkins Homepage—Item—New
You can also enter an existing Item and create a new item

Insert picture description here

Enter the project name, generally use the project name to name, then select the pipeline, confirm

Insert picture description here

4. Specific task configuration

Jenkins homepage—corresponding item—configuration—pipeline—clone address on gitee—generate pipeline script

Insert picture description here

#Go to gitee clone code address

Insert picture description here

Configured on Jenkins

Insert picture description here

Copy script

Insert picture description here

#Here is the configuration build script, note that Jenkins supports the construction of projects written in any language
Insert picture description here

Paste the link of the code to be built and the ssh command to be executed, it is recommended to add ls -l every time to build to verify whether it is successful, and save the application

Insert picture description here

5. Build verification

Enter the task, click Build Now, if it is successful, it will display green, you can verify the success in the Build History

Insert picture description here

Click the task, enter the task page, select the console output, you can see the detailed log of the build, if the build fails, you can view the failure reason in the log:
Insert picture description here

The above is the process of Jenkins software construction.

Guess you like

Origin blog.csdn.net/clover661/article/details/113124402