StripeExercise InstallJenkins.md

Chuck edited this page Oct 19, 2017 · 43 revisions

Install Jenkins (Basic, Non-Production)

This topic describes how to install a clean, non-production, stand-alone instance of Jenkins.

  • To upgrade a non-production instance, see Upgrading Jenkins.
  • Staging or production instances require additional installation and configuration steps, which are described in Advanced Jenkins Installation.
  • A stand-alone instance uses the built-in web server (Jetty). Jenkins can also run as one server in an existing framework, such as Tomcat or Glassfish. See Advanced Jenkins Installation for details.

Jenkins can be installed on the following systems:

For installation on other systems, see Advanced Jenkins Installation.

Once you complete the basic installation of Jenkins, you will need to create an admin user and password. You may also want to install additional plugins.

System Requirements

Minimum Recommended for Small Teams
Java Version 8 (JRE or JDK) 8
Memory (RAM) 256MB 1GB
Disk Space 1GB 50GB

For additional details, see Discussion of hardware recommendations.

UNIX/Linux

The procedure for installing Jenkins on a UNIX/Linux server depends on the flavor of UNIX/Linux:

Debian/Ubuntu

Use apt to install Jenkins on Debian-based Linux distributions, such as Ubuntu.

  1. Get a Jenkins package from an apt repository.
  2. Enter the following commands:
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins

This package installation will:

  • Set up Jenkins as a daemon launched on start. See /etc/init.d/jenkins for more details.
  • Create a jenkins user to run this service.
  • Direct console log output to the file /var/log/jenkins/jenkins.log. Check this file if you are troubleshooting Jenkins.
  • Populate /etc/default/jenkins with configuration parameters for the launch, such as JENKINS_HOME.
  • Set Jenkins to listen on port 8080. Access this port with your browser to start configuration.
    • If your /etc/init.d/jenkins file fails to start Jenkins, edit /etc/default/jenkins and replace 8080 in the line ----HTTP_PORT=8080---- with any available port value.

OpenIndiana Hipster

Jenkins can be installed in either the local or global zone using the Image Packaging System (IPS).

Disclaimer: This platform is NOT officially supported by the Jenkins team. Use it at your own risk. Packaging and integration described in this section is maintained by the OpenIndiana Hipster team, which bundles the generic jenkins.war to work in that operating environment.

  1. Enter the following commands:
pkg install jenkins
svcadm enable jenkins

This package installation will:

  • Create a jenkins user to run the service and to own the directory structures under /var/lib/jenkins.
  • Pull the OpenJDK8 and other packages required to execute Jenkins, including the jenkins-core-weekly package with the latest jenkins.war.
    • Long-Term Support (LTS) Jenkins releases currently do not support OpenZFS-based systems, so no packaging is provided at this time.
  • Set up Jenkins as an SMF service instance (svc:/network/http:jenkins) which can then be enabled with the svcadm command as used above.
  • Set up Jenkins to listen on port 8080.
  • Configure the log output to be managed by SMF at /var/svc/log/network-http:jenkins.log.

Solaris/OmniOS/SmartOS/similar

  1. Download jenkins.war from https://jenkins.io/download/.
  2. Run it as a standalone process or under an application server such as Apache Tomcat.

Notes:

  • Headless JVM and fonts: For OpenJDK builds on minimalized-footprint systems, there may be issues running the headless JVM because Jenkins needs specific fonts to render certain pages.
  • ZFS-related JVM crashes: When Jenkins runs on a system detected as a SunOS system, it tries to load integration for advanced ZFS features using the bundled libzfs.jar, which maps calls from Java to native libzfs.so routines provided by the host OS. However, that library was made for binary utilities built for and bundled with the OS and was never intended as a stable interface exposed to consumers. As the forks of Solaris legacy, including ZFS and later the OpenZFS initiative evolved, many different binary function signatures were provided by different host operating systems, and if Jenkins libzfs.jar invokes the wrong signature, the whole JVM process crashes. A solution was integrated into jenkins.war since weekly release 2.55 (but not in any LTS to date) that enables the administrator to configure which function signatures should be used for each function known to have different variants, apply it to their application server initialization options, and then run and update the generic jenkins.war without further workarounds. See the libzfs4j Git repository for more details, including a script to try and "lock-pick" the configuration needed for your particular distribution (in particular if your kernel updates bring a new incompatible libzfs.so).
  • Forks of the OpenZFS initiative may provide ZFS on various BSD, Linux, and macOS distributions. Once Jenkins supports detecting ZFS capabilities, rather than relying on the SunOS check, the above caveats for ZFS integration with Jenkins should be considered.

macOS

You can install Jenkins on macOS

  • Using a package
  • With brew

Using a package

  1. Download the latest package from http://mirrors.jenkins.io/osx/latest.
  2. Open the package and follow the instructions.

With brew

  1. Enter the following command:
    • For the latest release version brew install jenkins
    • For the LTS version brew install jenkins-lts

Windows

  1. Download the latest package from http://mirrors.jenkins.io/windows/latest.
  2. Open the package and follow the instructions.

Docker

  1. Enter the following command to pull the official Jenkins image from the Docker repository:
docker pull jenkins/jenkins
  1. Enter the following command to run a container using this image to map the data directory from the container to the host:
docker run -d -p [ContainerPort]:[JenkinsPort] -v $PWD/jenkins:[ContainerDirectory] -t [JenkinsDirectory]

For example, if you want the instance configured as follows:

Docker Jenkins
Port 49001 8080
Path /var/jenkins_home jenkins/

Enter the following command:

docker run -d -p 49001:8080 -v $PWD/jenkins:/var/jenkins_home -t jenkins/jenkins

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.