diff --git a/appliances/jenkins/Makefile b/appliances/jenkins/Makefile new file mode 100644 index 0000000..fc4aba0 --- /dev/null +++ b/appliances/jenkins/Makefile @@ -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 diff --git a/appliances/jenkins/jenkins.service b/appliances/jenkins/jenkins.service new file mode 100644 index 0000000..2b3a966 --- /dev/null +++ b/appliances/jenkins/jenkins.service @@ -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 diff --git a/appliances/jenkins/make.conf b/appliances/jenkins/make.conf new file mode 100644 index 0000000..33d8b2d --- /dev/null +++ b/appliances/jenkins/make.conf @@ -0,0 +1,2 @@ +# Settings for TeamPlayer +NGINX_MODULES_HTTP="auth_basic gzip proxy referer rewrite headers_more uwsgi" diff --git a/appliances/jenkins/nginx.conf b/appliances/jenkins/nginx.conf new file mode 100644 index 0000000..7bf2a0c --- /dev/null +++ b/appliances/jenkins/nginx.conf @@ -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; + #} +} diff --git a/appliances/jenkins/package.keywords b/appliances/jenkins/package.keywords new file mode 100644 index 0000000..daa1737 --- /dev/null +++ b/appliances/jenkins/package.keywords @@ -0,0 +1 @@ +sys-kernel/gentoo-sources ~amd64 ~x86 diff --git a/appliances/jenkins/package.use b/appliances/jenkins/package.use new file mode 100644 index 0000000..a71bf3a --- /dev/null +++ b/appliances/jenkins/package.use @@ -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 diff --git a/appliances/jenkins/world b/appliances/jenkins/world new file mode 100644 index 0000000..d0daf9d --- /dev/null +++ b/appliances/jenkins/world @@ -0,0 +1,2 @@ +dev-java/icedtea-bin +www-servers/nginx