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

Merge pull request #1 from aymhce/master

Configuration du port d'écoute
This commit is contained in:
julienmalik 2016-11-24 14:09:43 +01:00 committed by GitHub
commit 85082b9ac0
4 changed files with 22 additions and 4 deletions

View file

@ -1,5 +1,5 @@
location YNH_LOCATION { location YNH_LOCATION {
proxy_pass http://127.0.0.1:8080; proxy_pass http://127.0.0.1:YNH_PORT;
proxy_redirect off; proxy_redirect off;

View file

@ -37,6 +37,15 @@
}, },
"choices": ["Yes", "No"], "choices": ["Yes", "No"],
"default": "Yes" "default": "Yes"
},
{
"name": "port",
"ask": {
"en": "Internal running port ?",
"fr": "Port de fonctionnement interne ?"
},
"example": "8080",
"default": "8080"
} }
] ]
} }

View file

@ -4,10 +4,11 @@
domain=$1 domain=$1
path=$2 path=$2
is_public=$3 is_public=$3
port=$4
sudo yunohost app checkport 8080 sudo yunohost app checkport $port
if [[ ! $? -eq 0 ]]; then if [[ ! $? -eq 0 ]]; then
echo "Port 8080 is not available. Aborting..." echo "Port $port is not available. Aborting..."
exit 1 exit 1
fi fi
@ -32,6 +33,7 @@ then
# $ means 'process only the last line' # $ means 'process only the last line'
sudo sed -i '$ s@--ajp13Port=$AJP_PORT@--ajp13Port=$AJP_PORT --prefix=$PREFIX@g' /etc/default/jenkins sudo sed -i '$ s@--ajp13Port=$AJP_PORT@--ajp13Port=$AJP_PORT --prefix=$PREFIX@g' /etc/default/jenkins
fi fi
sudo sed -i "s/HTTP_PORT=.*/HTTP_PORT=$port/g" /etc/default/jenkins
sudo service jenkins restart sudo service jenkins restart
@ -39,6 +41,7 @@ sudo yunohost service add jenkins -l /var/log/jenkins/jenkins.log
echo "Nginx configuration (sso disabled)..." echo "Nginx configuration (sso disabled)..."
sed -i "s@YNH_LOCATION@$path@g" ../conf/nginx.conf sed -i "s@YNH_LOCATION@$path@g" ../conf/nginx.conf
sed -i "s@YNH_PORT@$port@g" ../conf/nginx.conf
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/jenkins.conf sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/jenkins.conf
sudo yunohost app setting jenkins is_public -v $is_public sudo yunohost app setting jenkins is_public -v $is_public
@ -47,5 +50,8 @@ then
sudo yunohost app setting jenkins unprotected_uris -v "/" sudo yunohost app setting jenkins unprotected_uris -v "/"
fi fi
# restart 2 times for debug
sudo service jenkins restart
sudo service nginx reload sudo service nginx reload
sudo yunohost app ssowatconf sudo yunohost app ssowatconf

View file

@ -5,11 +5,14 @@ domain=$(sudo yunohost app setting jenkins domain)
path=$(sudo yunohost app setting jenkins path) path=$(sudo yunohost app setting jenkins path)
path=${path%/} path=${path%/}
is_public=$(sudo yunohost app setting jenkins is_public) is_public=$(sudo yunohost app setting jenkins is_public)
port=$(sudo yunohost app setting jenkins port)
sudo sed -i "s/HTTP_PORT=.*/HTTP_PORT=$port/g" /etc/default/jenkins
sed -i "s@YNH_LOCATION@$path@g" ../conf/nginx.conf sed -i "s@YNH_LOCATION@$path@g" ../conf/nginx.conf
sed -i "s@YNH_PORT@$port@g" ../conf/nginx.conf
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/jenkins.conf sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/jenkins.conf
if [ "$is_public" = "Yes" ]; if [ "$is_public" = "Yes" ];
then then
sudo yunohost app setting jenkins unprotected_uris -v "/" sudo yunohost app setting jenkins unprotected_uris -v "/"