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

set useSecurity to false during install/upgrade

This commit is contained in:
Kay0u 2020-07-15 18:51:16 +02:00
parent 9e97a02cbe
commit 018e148506
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D
2 changed files with 12 additions and 4 deletions

View file

@ -175,7 +175,7 @@ ynh_systemd_action --action=restart --line_match="Jenkins is fully up and runnin
ynh_script_progression --message="Installing plugins..." --weight=60 ynh_script_progression --message="Installing plugins..." --weight=60
# If the log says that jenkins has started, install the plugins # If the log says that jenkins has started, install the plugins
wget -nv --no-check-certificate https://$domain$path_url/jnlpJars/jenkins-cli.jar -O /var/lib/jenkins/jenkins-cli.jar wget -nv --no-check-certificate https://$domain${path_url%/}/jnlpJars/jenkins-cli.jar -O /var/lib/jenkins/jenkins-cli.jar
for i in `seq 1 $timeout` for i in `seq 1 $timeout`
do do
# Wait for an update of plugin repositories # Wait for an update of plugin repositories
@ -187,7 +187,10 @@ do
fi fi
done done
jenkins_cli="ynh_exec_warn_less java -jar /var/lib/jenkins/jenkins-cli.jar -s http://${domain}:${port}${path_url}" ynh_replace_string --match_string="<useSecurity>true</useSecurity>" --replace_string="<useSecurity>false</useSecurity>" --target_file=/var/lib/jenkins/config.xml
ynh_systemd_action --action=restart --line_match="Jenkins is fully up and running" --log_path="/var/log/$app/$app.log" --timeout="$timeout"
jenkins_cli="ynh_exec_warn_less java -jar /var/lib/jenkins/jenkins-cli.jar -s http://${domain}:${port}${path_url%/}"
# Install plugins for http authentication and ldap. # Install plugins for http authentication and ldap.
$jenkins_cli install-plugin reverse-proxy-auth-plugin $jenkins_cli install-plugin reverse-proxy-auth-plugin

View file

@ -160,20 +160,25 @@ ynh_systemd_action --action=restart --line_match="Jenkins is fully up and runnin
#================================================= #=================================================
ynh_script_progression --message="Upgrading jenkins-cli.phar..." ynh_script_progression --message="Upgrading jenkins-cli.phar..."
wget -nv --no-check-certificate https://$domain$path_url/jnlpJars/jenkins-cli.jar -O /var/lib/jenkins/jenkins-cli.jar wget -nv --no-check-certificate https://$domain${path_url%/}/jnlpJars/jenkins-cli.jar -O /var/lib/jenkins/jenkins-cli.jar
#================================================= #=================================================
# UPGRADE PLUGINS # UPGRADE PLUGINS
#================================================= #=================================================
ynh_script_progression --message="Upgrading plugins..." --weight=40 ynh_script_progression --message="Upgrading plugins..." --weight=40
jenkins_cli="ynh_exec_warn_less java -jar /var/lib/jenkins/jenkins-cli.jar -s http://${domain}:${port}${path_url}" ynh_replace_string --match_string="<useSecurity>true</useSecurity>" --replace_string="<useSecurity>false</useSecurity>" --target_file=/var/lib/jenkins/config.xml
ynh_systemd_action --action=restart --line_match="Jenkins is fully up and running" --log_path="/var/log/$app/$app.log" --timeout="3600"
jenkins_cli="ynh_exec_warn_less java -jar /var/lib/jenkins/jenkins-cli.jar -s http://${domain}:${port}${path_url%/}"
UPDATE_LIST=$($jenkins_cli list-plugins | grep -e ')$' | awk '{ print $1 }' ) UPDATE_LIST=$($jenkins_cli list-plugins | grep -e ')$' | awk '{ print $1 }' )
if [ -n "${UPDATE_LIST}" ]; then if [ -n "${UPDATE_LIST}" ]; then
$jenkins_cli install-plugin "${UPDATE_LIST}" $jenkins_cli install-plugin "${UPDATE_LIST}"
fi fi
ynh_replace_string --match_string="<useSecurity>false</useSecurity>" --replace_string="<useSecurity>true</useSecurity>" --target_file=/var/lib/jenkins/config.xml
ynh_systemd_action --action=restart --line_match="Jenkins is fully up and running" --log_path="/var/log/$app/$app.log" --timeout="3600" ynh_systemd_action --action=restart --line_match="Jenkins is fully up and running" --log_path="/var/log/$app/$app.log" --timeout="3600"
#================================================= #=================================================