From 4e068ed1b77b7577640cf41f33e1cbc55d20ab3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A9veloppeur=20=C3=A9gar=C3=A9?= Date: Fri, 27 Feb 2015 14:26:59 +0100 Subject: [PATCH 1/8] Update manifest.json --- manifest.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/manifest.json b/manifest.json index 704f449..73dd1ec 100644 --- a/manifest.json +++ b/manifest.json @@ -37,6 +37,15 @@ }, "choices": ["Yes", "No"], "default": "Yes" + }, + { + "name": "port", + "ask": { + "en": "Internal running port ?", + "fr": "Port de fonctionnement interne ?" + }, + "example": "8080", + "default": "8080" } ] } From 98eae383c01cf4149b4eca942a182c76e647ff39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A9veloppeur=20=C3=A9gar=C3=A9?= Date: Fri, 27 Feb 2015 14:36:54 +0100 Subject: [PATCH 2/8] Update install --- scripts/install | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index f7f37b3..5be06d0 100644 --- a/scripts/install +++ b/scripts/install @@ -4,10 +4,11 @@ domain=$1 path=$2 is_public=$3 +port=$4 -sudo yunohost app checkport 8080 +sudo yunohost app checkport $port if [[ ! $? -eq 0 ]]; then - echo "Port 8080 is not available. Aborting..." + echo "Port $port is not available. Aborting..." exit 1 fi @@ -32,6 +33,8 @@ then # $ means 'process only the last line' sudo sed -i '$ s@--ajp13Port=$AJP_PORT@--ajp13Port=$AJP_PORT --prefix=$PREFIX@g' /etc/default/jenkins fi +sudo sed -i 's@@$path@g' /etc/default/jenkins +sudo sed -i "/HTTP_PORT=.*/aHTTP_PORT=$port" /etc/default/jenkins sudo service jenkins restart @@ -39,6 +42,7 @@ 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 +sed -i "s@YNH_PORT@$port@g" ../conf/nginx.conf sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/jenkins.conf sudo yunohost app setting jenkins is_public -v $is_public From 1e0bb7c560e786fc082dd2fd468a96098a05972f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A9veloppeur=20=C3=A9gar=C3=A9?= Date: Fri, 27 Feb 2015 14:37:09 +0100 Subject: [PATCH 3/8] Update nginx.conf --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index f171bf2..86f9cdc 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,5 +1,5 @@ location YNH_LOCATION { - proxy_pass http://127.0.0.1:8080; + proxy_pass http://127.0.0.1:YNH_PORT; proxy_redirect off; From f04f991172681ad662539d18189d6e0034e6ca2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A9veloppeur=20=C3=A9gar=C3=A9?= Date: Fri, 27 Feb 2015 14:38:57 +0100 Subject: [PATCH 4/8] Update install --- scripts/install | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/install b/scripts/install index 5be06d0..84b5e19 100644 --- a/scripts/install +++ b/scripts/install @@ -33,7 +33,6 @@ then # $ means 'process only the last line' sudo sed -i '$ s@--ajp13Port=$AJP_PORT@--ajp13Port=$AJP_PORT --prefix=$PREFIX@g' /etc/default/jenkins fi -sudo sed -i 's@@$path@g' /etc/default/jenkins sudo sed -i "/HTTP_PORT=.*/aHTTP_PORT=$port" /etc/default/jenkins sudo service jenkins restart From d6e6ba1e914dd192a771e40485097f00531cf82c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A9veloppeur=20=C3=A9gar=C3=A9?= Date: Fri, 27 Feb 2015 14:41:04 +0100 Subject: [PATCH 5/8] Update upgrade --- scripts/upgrade | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 9a7ae48..37c55fe 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -5,11 +5,14 @@ domain=$(sudo yunohost app setting jenkins domain) path=$(sudo yunohost app setting jenkins path) path=${path%/} is_public=$(sudo yunohost app setting jenkins is_public) +port=$(sudo yunohost app setting jenkins port) + +sudo sed -i "/HTTP_PORT=.*/aHTTP_PORT=$port" /etc/default/jenkins 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 - if [ "$is_public" = "Yes" ]; then sudo yunohost app setting jenkins unprotected_uris -v "/" From 28845adbd8d781e5d1a477779b772808e0d8c074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A9veloppeur=20=C3=A9gar=C3=A9?= Date: Fri, 27 Feb 2015 15:23:42 +0100 Subject: [PATCH 6/8] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 37c55fe..b3c3b2c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -7,7 +7,7 @@ path=${path%/} is_public=$(sudo yunohost app setting jenkins is_public) port=$(sudo yunohost app setting jenkins port) -sudo sed -i "/HTTP_PORT=.*/aHTTP_PORT=$port" /etc/default/jenkins +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_PORT@$port@g" ../conf/nginx.conf From a93255d5f12837929be4a8d7eb43a96d29aa88a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A9veloppeur=20=C3=A9gar=C3=A9?= Date: Fri, 27 Feb 2015 15:23:55 +0100 Subject: [PATCH 7/8] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 84b5e19..c1a5c92 100644 --- a/scripts/install +++ b/scripts/install @@ -33,7 +33,7 @@ then # $ means 'process only the last line' sudo sed -i '$ s@--ajp13Port=$AJP_PORT@--ajp13Port=$AJP_PORT --prefix=$PREFIX@g' /etc/default/jenkins fi -sudo sed -i "/HTTP_PORT=.*/aHTTP_PORT=$port" /etc/default/jenkins +sudo sed -i "s/HTTP_PORT=.*/HTTP_PORT=$port/g" /etc/default/jenkins sudo service jenkins restart From 5ba7cc2e5b355adc663a7be7d4d55f97fba08f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A9veloppeur=20=C3=A9gar=C3=A9?= Date: Fri, 27 Feb 2015 16:05:49 +0100 Subject: [PATCH 8/8] Update install --- scripts/install | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/install b/scripts/install index c1a5c92..c1fab09 100644 --- a/scripts/install +++ b/scripts/install @@ -50,5 +50,8 @@ then sudo yunohost app setting jenkins unprotected_uris -v "/" fi +# restart 2 times for debug +sudo service jenkins restart + sudo service nginx reload sudo yunohost app ssowatconf