1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jenkins_ynh.git synced 2024-09-03 19:26:18 +02:00

[enh] firs commit

This commit is contained in:
Julien Malik 2014-12-09 21:00:17 +01:00
commit c67a51cc64
5 changed files with 117 additions and 0 deletions

27
conf/nginx.conf Normal file
View file

@ -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;
}

36
manifest.json Normal file
View file

@ -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"
}
]
}
}

36
scripts/install Normal file
View file

@ -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

10
scripts/remove Normal file
View file

@ -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

8
scripts/upgrade Normal file
View file

@ -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