commit c67a51cc647cff5da20e10e3620698cb027afac0 Author: Julien Malik Date: Tue Dec 9 21:00:17 2014 +0100 [enh] firs commit diff --git a/conf/nginx.conf b/conf/nginx.conf new file mode 100644 index 0000000..35149a4 --- /dev/null +++ b/conf/nginx.conf @@ -0,0 +1,27 @@ +location YNH_LOCATION { + proxy_pass http://127.0.0.1:8080$request_uri; + + proxy_redirect off; + + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_set_header X-NginX-Proxy true; + proxy_set_header X-Forwarded-Proto $scheme; + + proxy_max_temp_file_size 0; + + client_max_body_size 10m; + client_body_buffer_size 128k; + + proxy_connect_timeout 4m; + proxy_send_timeout 4m; + proxy_read_timeout 4m; + + proxy_buffer_size 4k; + proxy_buffers 4 32k; + proxy_busy_buffers_size 64k; + proxy_temp_file_write_size 64k; + + sendfile off; +} diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..5871ba0 --- /dev/null +++ b/manifest.json @@ -0,0 +1,36 @@ +{ + "name": "Jenkins", + "id": "jenkins", + "description": { + "en": "Jenkins", + "fr": "Jenkins" + }, + "developer": { + "name": "Julien Malik", + "email": "julien.malik@paraiso.me" + }, + "multi_instance": "false", + "arguments": { + "install" : [ + { + "name": "domain", + "ask": { + "en": "Choose a domain for Jenkins", + "fr": "Choisissez un domaine pour Jenkins" + }, + "example": "domain.org" + }, + { + "name": "path", + "ask": { + "en": "Choose a path for Jenkins", + "fr": "Choisissez un path pour Jenkins" + }, + "example": "/jenkins", + "default": "/jenkins" + } + ] + } +} + + diff --git a/scripts/install b/scripts/install new file mode 100644 index 0000000..502721c --- /dev/null +++ b/scripts/install @@ -0,0 +1,36 @@ +#!/bin/bash + +# Retrieve arguments +domain=$1 +path=$2 + +sudo yunohost app checkport 8080 +if [[ ! $? -eq 0 ]]; then + echo "Port 8080 is not available. Aborting..." + exit 1 +fi + +# Check domain/path availability +sudo yunohost app checkurl $domain$path -a jenkins +if [[ ! $? -eq 0 ]]; then + exit 1 +fi + +echo "Install dependencies..." +wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add - +sudo bash -c "cat > /etc/apt/sources.list.d/jenkins.list << EOF +deb http://pkg.jenkins-ci.org/debian binary/ +EOF +" + +sudo apt-get update +sudo apt-get install jenkins -y +sudo service jenkins start + +sudo yunohost service add jenkins -l /var/log/jenkins/jenkins.log + +echo "Nginx configuration (sso disabled)..." +sed -i "s@YNH_LOCATION@$path@g" ../conf/nginx.conf +sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/jenkins.conf +sudo service nginx reload +sudo yunohost app ssowatconf diff --git a/scripts/remove b/scripts/remove new file mode 100644 index 0000000..d09079f --- /dev/null +++ b/scripts/remove @@ -0,0 +1,10 @@ +#!/bin/bash + +domain=$(sudo yunohost app setting jenkins domain) + +sudo yunohost service remove ynh-jenkins + +sudo apt-get purge jenkins +sudo rm /etc/apt/sources.list.d/jenkins.list +# TODO remove repo key +sudo apt-get update diff --git a/scripts/upgrade b/scripts/upgrade new file mode 100644 index 0000000..dcfd408 --- /dev/null +++ b/scripts/upgrade @@ -0,0 +1,8 @@ +#!/bin/bash + +# Retrieve arguments +domain=$(sudo yunohost app setting jenkins domain) +path=$(sudo yunohost app setting jenkins path) +path=${path%/} + +# TODO