System environment
- Operating system: CentOS6.9
- Java Jdk:java 8
- Jenkins version: jenkins-2.78-1.1.noarch.rpm
- Shutting down the firewall
Note: If you are building a. NET project based on MSBuild, the best practice is to build the Jenkins service on Windows Server because MSBuild is integrated in the. NET Framework Framework!!!
Windows Server 2008r2 Sp1:iis-->ie11-->vs (with Update5)-->java jdk8-->jenkins installation Step 1, Check if Java JDK is already installed
Run the following command: [[email protected] ~]# Rpm-qa | grep java
If it is already installed and is not a Java 8 version, run the following command to bulk unload all files with Java and then reload.
[Email protected] ~]# Rpm-qa | grep java | Xargs rpm-e--nodeps
2, installing Java 8
Download the latest RPM package for Java 8 locally and upload it to a Linux server and install it by running the following command:
[Email protected] softwares]# RPM-IVH jre-8u144-linux-x64.rpm
After the installation is complete, run the following command to verify that the installation was successful.
[Email protected] ~]# java-version
3, installing Jenkins
Download the latest RPM package from Jenkins locally and upload it to the Linux server and install it by running the following command:
[Email protected] softwares]# RPM-IVH jenkins-2.78-1.1.noarch.rpm
4, configuring environment variables
Modify the/etc/profile file and append the following at the end:
#set Java enviroment
Export java_home=/usr/java/jre1.8.0_144
Export path= $JAVA _home/bin: $PATH
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Then execute the following command to make the configuration take effect immediately.
[Email protected] lib]# Source/etc/profile
5, Start Jenkins
Run the following command to start Jenkins immediately.
[[Email protected] lib]# Service Jenkins start
Add Jenkins to the boot auto start and run the following command.
[[email protected] lib]# Chkconfig Jenkins on
Admin account: admin\[email protected]
6, install the plugin
Based on the development environment of the. NET Framework4.5.1+vs 2015, the following plugins need to be installed.
MSBuild Plugin
Team Foundation Server Plugin
Nuget Plugin
GitLab Plugin
FTP Publisher Plugin
role-based Authorization Strategy
... Precautions
1,jenkins cannot be accessed via the web after startup
View Jenkins status, which displays the following information: Jenkins dead but PID file exists
The reason is that Jenkins uses port 8080 by default, but the 8080 port on this machine is already in use, so you need to modify the port number of Jenkins and run the following command:
[Email protected] java]# Vim/etc/sysconfig/jenkins
Modify the values of the following items
It's ready to start again!
2,error msb1008:only One project can be specified
Workaround: Reinstall the installation path of jenkins,jenkins can not have spaces, directly installed in the C packing directory.
3,error msb4019:the imported Project "C:\Program Files (x86) \msbuild\microsoft\visualstudio\v14.0\webapplications\ Microsoft.WebApplication.targets "was not found
Workaround:
One way is to install vs2013 on the Jenkins server.
Another way is to copy the directory on the development machine to the Jenkins server.
4,c:\windows\microsoft.net\framework\v4.0.30319\microsoft.common.targets (2015,5): Error MSB3091: Task failed because "not found" AxImp.exe ", or the correct Microsoft Windows SDK is not installed. The task is registering a registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Sdks\windows\v8.0a\winsdk-netfx40tools-x86 Find "AxImp.exe" in the "bin" subdirectory at the location specified in the InstallationFolder value. You can resolve this issue by doing one of the following: 1) Install the Microsoft Windows SDK. 2) Install Visual Studio 2010. 3) Manually set the above registry key to the correct location. 4) pass the correct position into the "toolpath" parameter of the task. [C:\Jenkins\workspace\master.ubtrip.dev\SSharing.Ubtrip.UI\SSharing.Ubtrip.UI.csproj]
5, be sure to enable the Web Deploy Publishing feature on the site
6, note the/p:deployiisapppath parameter
Resources
- Official website: https://jenkins.io/index.html,https://pkg.jenkins.io/redhat/
- CentOS 6.7 Installation Jenkins record: https://www.biaodianfu.com/centos-6-install-jenkins.html
Jenkins Server Setup under Linux