appliances: new appliance: jenkins

This appliance runs the Jenkins[1] continuous integration tool.  The
service is available via HTTP port 80.

[1] http://jenkins-ci.org/
This commit is contained in:
Albert Hopkins 2015-12-11 01:27:50 +00:00
parent 42d8f6df45
commit a8eb60d006
7 changed files with 145 additions and 0 deletions

View File

@ -0,0 +1,36 @@
JENKINS_HOME ?= /var/lib/jenkins
JENKINS_URL = http://mirrors.jenkins-ci.org/war/latest/jenkins.war
preinstall:
create_user:
-$(inroot) useradd --system \
--comment "Jenkins CI" \
--home-dir=$(JENKINS_HOME) \
--create-home \
jenkins
$(CHROOT)/$(JENKINS_HOME)/jenkins.war:
$(inroot) wget -O $(JENKINS_HOME)/jenkins.war $(JENKINS_URL)
install_jenkins:
$(MAKE) $(CHROOT)/$(JENKINS_HOME)/jenkins.war
postinstall: jenkins.service nginx.conf
$(MAKE) create_user
$(inroot) rm -rf $(JENKINS_HOME)
$(inroot) mkdir -p $(JENKINS_HOME)
$(MAKE) install_jenkins
$(inroot) chown -R jenkins:jenkins $(JENKINS_HOME)
cp -u jenkins.service $(CHROOT)/etc/systemd/system
$(inroot) systemctl enable jenkins.service
cp -u nginx.conf $(CHROOT)/etc/nginx/nginx.conf
$(inroot) systemctl enable nginx.service
clean:
.PHONY: create_user preinstall postinstall clean install_jenkins

View File

@ -0,0 +1,13 @@
[Unit]
Description = An extensible open source continuous integration server
After = network.target
Wants = nginx.service
[Service]
User = jenkins
Group = jenkins
Environment=JENKINS_HOME=/var/lib/jenkins
ExecStart = /usr/bin/java -jar ${JENKINS_HOME}/jenkins.jar
[Install]
WantedBy = multi-user.target

View File

@ -0,0 +1,2 @@
# Settings for TeamPlayer
NGINX_MODULES_HTTP="auth_basic gzip proxy referer rewrite headers_more uwsgi"

View File

@ -0,0 +1,76 @@
user nginx nginx;
worker_processes 1;
error_log /var/log/nginx/error_log info;
events {
worker_connections 1024;
use epoll;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main
'$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" '
'"$gzip_ratio"';
client_header_timeout 10m;
client_body_timeout 10m;
send_timeout 10m;
connection_pool_size 256;
client_header_buffer_size 1k;
large_client_header_buffers 4 2k;
request_pool_size 4k;
gzip on;
gzip_min_length 1100;
gzip_buffers 4 8k;
gzip_types text/plain;
output_buffers 1 32k;
postpone_output 1460;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 75 20;
ignore_invalid_headers on;
index index.html;
server {
listen 0.0.0.0;
server_name localhost;
access_log /var/log/nginx/jenkins.access_log main;
error_log /var/log/nginx/jenkins.error_log info;
root /var/www/jenkins/htdocs;
location / {
proxy_pass http://127.0.0.1:8080/;
}
}
# SSL example
#server {
# listen 127.0.0.1:443;
# server_name localhost;
# ssl on;
# ssl_certificate /etc/ssl/nginx/nginx.pem;
# ssl_certificate_key /etc/ssl/nginx/nginx.key;
# access_log /var/log/nginx/jenkins.ssl_access_log main;
# error_log /var/log/nginx/jenkins.ssl_error_log info;
# root /var/www/jenkins/htdocs;
#}
}

View File

@ -0,0 +1 @@
sys-kernel/gentoo-sources ~amd64 ~x86

View File

@ -0,0 +1,15 @@
app-editors/nano ncurses
dev-lang/python ssl threads xml
dev-libs/libpcre cxx
dev-util/pkgconfig internal-glib
net-misc/openssh ssl
net-misc/wget ssl
sys-apps/hwids udev
sys-apps/kmod tools
sys-apps/portage ipc
sys-auth/pambase nullok sha512
sys-devel/gcc cxx nptl
sys-kernel/gentoo-sources symlink
# for Jenkins
www-servers/nginx http

2
appliances/jenkins/world Normal file
View File

@ -0,0 +1,2 @@
dev-java/icedtea-bin
www-servers/nginx