ArchLinux 2017.10.01: Install Jenkins for CI server

Table of Contents

1 Install Jenkins

The following script will install Jenkins and enable http access via Apache.

#!/bin/shset -ejenkins_install(){ sudo pacman -Sy –noconfirm jenkins . /etc/conf.d/jenkins JENKINS_OPTS=”$JENKINS_OPTS –prefix=/jenkins” sudo sed -i /etc/conf.d/jenkins -e “s;^JENKINS_OPTS=.*;JENKINS_OPTS=”$JENKINS_OPTS”;g” sudo systemctl enable jenkins sudo systemctl start jenkins}apache_install(){ sudo pacman -Ss –noconfirm apache # https configuration. yes “” | sudo openssl req -new -x509 -nodes -newkey rsa:4096 -days 1095 -keyout /etc/httpd/conf/server.key -out /etc/httpd/conf/server.crt sudo sed -e ‘s/^#LoadModule ssl_module/LoadModule ssl_module/g’ -e ‘s/^#LoadModule socache_shmcb_module/LoadModule socache_shmcb_module/g’ -i /etc/httpd/conf/httpd.conf cat <<EOF | sudo tee -a /etc/httpd/conf/httpd.confInclude conf/extra/httpd-ssl.confEOF # proxy configuration. sudo sed -i /etc/httpd/conf/httpd.conf -e ‘s/^#LoadModule proxy_module/LoadModule proxy_module/g’ -e ‘s/^#LoadModule proxy_http_module/LoadModule proxy_http_module/g’ # rewrite configuration. sudo sed -i /etc/httpd/conf/httpd.conf -e ‘s/^#LoadModule rewrite_module/LoadModule rewrite_module/g’ # Jenkins configuration. cat << EOF | sudo tee /etc/httpd/conf/extra/jenkins.confProxyRequests OffProxyPreserveHost OnProxyPass /jenkins http://localhost:8090/jenkinsProxyPassReverse /jenkins http://localhost:8090/jenkinsRewriteEngine OnRewriteCond %{HTTPS} offRewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}AllowEncodedSlashes NoDecode<Proxy http://localhost:8090/jenkins> Order deny,allow Allow from all</Proxy>EOF cat <<EOF | sudo tee -a /etc/httpd/conf/httpd.confInclude conf/extra/jenkins.confEOF sudo systemctl enable httpd sudo systemctl restart httpd}jenkins_main(){ jenkins_install apache_install}jenkins_main

2 Access to Jenkins

Access to the following URL.



Android | Linux | SDL - Narrow Escape