1 Download Package
- Jenkins
Visit https://jenkins.io/download/to download the latest (LTS version) War pack.
- Tomcat
Visit https://tomcat.apache.org/download-90.cgi to download the latest Tomcat 9.0.
- Cloudbees-folder
Visit http://ftp.icm.edu.pl/packages/jenkins/plugins/cloudbees-folder/to download the latest Cloudbees-folder plugin.
2 Environment Configuration
- Install Java 8in advance and
/etc/profile
configure environment variables in files (or other configuration files) JAVA_HOME
.
- Extract the Tomcat compression package into
~/Jenkins/
the directory, ~/Jenkins/apache-tomcat-9.0.5/bin
catalina.sh
shutdown.sh
and startup.sh
Add execute permissions to the directory. (chmod +x *.sh
)
- Put the first step in the download
jenkins.war
to the ~/Jenkins/apache-tomcat-9.0.5/webapps/
directory.
3 Starting Tomcat
- Execute the
~/Jenkins/apache-tomcat-9.0.5/bin/startup.sh
script to start Tomcat ( ./startup.sh
).
After Tomcat starts, Jenkins.war will be automatically decompressed to generate a Jenkins directory.
- Browser Access
http://localhost:8080/jenkins/
enters Jenkins's unlock interface (Unlock Jenkins) and requires an administrator password to continue accessing Jenkins.
The administrator password exists with a initialAdminPassword
file named, the location of the file is displayed in the Unlock interface ( ~/.jenkins/secrets/initialAdminPassword
).
- After entering the administrator password will go to the plug-in installation interface, some machines installed Jenkins can not access the URL at the beginning of HTTPS, and download plug-ins need to access Https://updates.jenkins.io/current/update-center.json, So there may be Offline .
At this point, you need to change a file named Files hudson.model.UpdateCenter.xml
that are located in the ~/.jenkins/
directory. Replace the URLs in the URL tags in the file with a URL for a mirrored web site that begins with HTTP, such as Http://mirror.xmission.com/jenkins/updates/update-center.json.
Reboot Tomcat ( shutdown.sh
close First, then startup.sh
Open).
- Re-enter the plug-in installation interface should be able to see the content, but click Install plugin will appear an error:
No such plugin: cloudbees-folder
, this plugin Jenkins.war is not included in the default, so need to install manually.
Installation method: The first step to download the files in the cloudbees-folder.hpi
~/Jenkins/apache-tomcat-9.0.5/webapps/jenkins/WEB-INF/detached-plugins/
directory and ~/.jenkins/plugins/
directory can be.
4 Resetting the Administrator password (optional)
After you enter Jenkins, you can reset the password for the admin account in the administration user , so that you don't need to see initialAdminPassword
the password in the file the next time you sign in.
5 Installing the plug-in (optional)
You can install some plugins in the System Management--Admin plugin interface for easy use (such as pipeline, Blueocean, Gerrit Trigger, Timestamper, Jira, etc.), if the online installation plugin fails, You can also download the plugin (. hpi) locally via your browser and install it via the upload plugin feature in the Advanced tab.
Note: The above is just one way to install Jenkins.
In addition, it can be java -Djsse.enableSNIExtension=false -jar jenkins.war --httpPort=8081
installed by command because Jenkins.war has a built-in Jetty Server, which is no longer detailed.
Jenkins also provides a binary installation package for each platform, and it is easy to install it directly using the installation package.
A brief installation method of Jenkins under Linux system