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

Fix install

This commit is contained in:
yalh76 2022-03-19 00:36:12 +01:00
parent 64adde4f81
commit 32cf3d7610
6 changed files with 23 additions and 23 deletions

View file

@ -40,4 +40,4 @@
<nodeProperties/>
<globalNodeProperties/>
<nodeRenameMigrationNeeded>false</nodeRenameMigrationNeeded>
</hudson>
</hudson>

View file

@ -7,6 +7,8 @@
# dependencies used by the app
pkg_dependencies="openjdk-11-jdk daemon net-tools"
JENKINS_VERSION="2.332.1"
#=================================================
# PERSONAL HELPERS
#=================================================

View file

@ -1,4 +1,4 @@
ss#!/bin/bash
#!/bin/bash
#=================================================
# GENERIC START
@ -65,7 +65,7 @@ ynh_backup --src_path="/etc/default/$app"
# START SYSTEMD SERVICE
#=================================================
ynh_systemd_action --service_name=$app --action="restart" --line_match="Started" --log_path="systemd"
ynh_systemd_action --service_name=$app --action="restart" --line_match="Started Jenkins Continuous Integration Server" --log_path="systemd"
#=================================================
# END OF SCRIPT

View file

@ -134,8 +134,16 @@ ynh_script_progression --message="Setuping application..."
ynh_script_progression --message="Configuring SSOwat..."
# Making the app public for curl
ynh_permission_update --permission="main" --add="visitors"
# Reload SSOwat config
yunohost app ssowatconf
cat >> "$final_path/jenkins.install.InstallUtil.lastExecVersion" <<EOF
$JENKINS_VERSION
EOF
chown $app:$app "$final_path/jenkins.install.InstallUtil.lastExecVersion"
cat >> "$final_path/jenkins.install.UpgradeWizard.state" <<EOF
$JENKINS_VERSION
EOF
chown $app:$app "$final_path/jenkins.install.UpgradeWizard.state"
# Ignore Setup Wizard
ynh_replace_string --match_string="\-Djava.awt.headless=true" --replace_string="& -Djenkins.install.runSetupWizard=false" --target_file=/etc/default/jenkins
@ -151,16 +159,13 @@ timeout=3600
# Add the domain to /etc/hosts, to prevent any dns delay
echo "127.0.0.1 $domain #jenkins" | tee -a /etc/hosts
# Wait for Jenkins to be fully started
ynh_systemd_action --service_name=$app --action="restart" --line_match="Started" --log_path="systemd" --timeout="$timeout"
# Enable Jenkins CLI Protocol/2 for jenkins-cli
# That the only protocol that allow connection without an authenticated user...
cp -f ../conf/config_unsecured.xml $final_path/config.xml
chown jenkins: $final_path/config.xml
# Wait for Jenkins to be fully started
ynh_systemd_action --service_name=$app --action="restart" --line_match="Started" --log_path="systemd" --timeout="$timeout"
ynh_systemd_action --service_name=$app --action="restart" --line_match="Started Jenkins Continuous Integration Server" --log_path="systemd" --timeout="$timeout"
ynh_script_progression --message="Installing plugins..."
@ -212,21 +217,14 @@ $jenkins_cli install-plugin fstrigger
# Set global security with ldap
cp -f ../conf/config.xml $final_path/
chown jenkins: $final_path/config.xml
ynh_store_file_checksum --file="/etc/default/jenkins"
ynh_store_file_checksum --file="$final_path/config.xml"
# Clean hosts file
sed -i '/#jenkins/d' /etc/hosts
ynh_permission_update --permission="main" --remove="visitors"
#=================================================
# STORE THE CONFIG FILE CHECKSUM
#=================================================
ynh_script_progression --message="Storing the config file checksum..."
# Calculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="/etc/default/jenkins"
ynh_store_file_checksum --file="$final_path/config.xml"
#=================================================
# GENERIC FINALIZATION
#=================================================
@ -242,7 +240,7 @@ yunohost service add $app --description="Extendable continuous integration serve
ynh_script_progression --message="Starting a systemd service..."
# Start a systemd service
ynh_systemd_action --service_name=$app --action="restart" --line_match="Started" --log_path="systemd" --timeout="$timeout"
ynh_systemd_action --service_name=$app --action="restart" --line_match="Started Jenkins Continuous Integration Server" --log_path="systemd" --timeout="$timeout"
#=================================================
# SETUP SSOWAT

View file

@ -121,7 +121,7 @@ yunohost service add $app --description="Extendable continuous integration serve
#=================================================
ynh_script_progression --message="Starting a systemd service..."
ynh_systemd_action --service_name=$app --action="restart" --line_match="Started" --log_path="systemd" --timeout="3600"
ynh_systemd_action --service_name=$app --action="restart" --line_match="Started Jenkins Continuous Integration Server" --log_path="systemd" --timeout="3600"
#=================================================
# SEND A README FOR THE ADMIN

View file

@ -151,7 +151,7 @@ ynh_systemd_action --service_name=nginx --action=reload
ynh_script_progression --message="Restarting Jenkins..."
# Wait for Jenkins to be fully started
ynh_systemd_action --service_name=$app --action="restart" --line_match="Started" --log_path="systemd" --timeout="3600"
ynh_systemd_action --service_name=$app --action="restart" --line_match="Started Jenkins Continuous Integration Server" --log_path="systemd" --timeout="3600"
#=================================================
# UPGRADE JENKINS-CLI.JAR
@ -171,7 +171,7 @@ cp $final_path/config.xml $final_path/config.xml.bak
cp -f ../conf/config_unsecured.xml $final_path/config.xml
chown jenkins: $final_path/config.xml
ynh_systemd_action --service_name=$app --action="restart" --line_match="Started" --log_path="systemd" --timeout="3600"
ynh_systemd_action --service_name=$app --action="restart" --line_match="Started Jenkins Continuous Integration Server" --log_path="systemd" --timeout="3600"
jenkins_cli="ynh_exec_warn_less java -jar $final_path/jenkins-cli.jar -s http://127.0.0.1:${port}${path_url%/}"
UPDATE_LIST=$($jenkins_cli list-plugins | grep -oP '^(.*?) ')
@ -201,7 +201,7 @@ yunohost service add $app --description="Extendable continuous integration serve
#=================================================
ynh_script_progression --message="Starting a systemd service..."
ynh_systemd_action --service_name=$app --action="restart" --line_match="Started" --log_path="systemd"
ynh_systemd_action --service_name=$app --action="restart" --line_match="Started Jenkins Continuous Integration Server" --log_path="systemd"
#=================================================
# SEND A README FOR THE ADMIN