mirror of
https://github.com/YunoHost-Apps/jenkins_ynh.git
synced 2024-09-03 19:26:18 +02:00
commit
0e1aae7be8
19 changed files with 141 additions and 264 deletions
16
README.md
16
README.md
|
@ -1,21 +1,21 @@
|
|||
# Jenkins for YunoHost
|
||||
|
||||
[![Integration level](https://dash.yunohost.org/integration/jenkins.svg)](https://dash.yunohost.org/appci/app/jenkins) ![](https://ci-apps.yunohost.org/ci/badges/jenkins.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/jenkins.maintain.svg)
|
||||
[![Install Jenkins with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=jenkins)
|
||||
[![Install Jenkins with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=jenkins)
|
||||
|
||||
*[Lire ce readme en français.](./README_fr.md)*
|
||||
|
||||
> *This package allow you to install jenkins quickly and simply on a YunoHost server.
|
||||
> *This package allow you to install Jenkins quickly and simply on a YunoHost server.
|
||||
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.*
|
||||
|
||||
## Overview
|
||||
The leading open source automation server, Jenkins provides hundreds of plugins to support building, deploying and automating any project.
|
||||
|
||||
**Shipped version:** 2.235.2
|
||||
**Shipped version:** 2.263.1
|
||||
|
||||
## Screenshots
|
||||
|
||||
![](https://crudelis.fr/lutim/w8DlycXB.png)
|
||||
![](https://upload.wikimedia.org/wikipedia/commons/8/8d/Ansible-playbook-output-jenkins.png)
|
||||
|
||||
## Demo
|
||||
|
||||
|
@ -38,14 +38,11 @@ Supported, with LDAP and SSO.
|
|||
|
||||
#### Supported architectures
|
||||
|
||||
* x86-64b - [![](https://ci-apps.yunohost.org/ci/logs/jenkins%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/jenkins/)
|
||||
* x86-64 - [![](https://ci-apps.yunohost.org/ci/logs/jenkins%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/jenkins/)
|
||||
* ARMv8-A - [![](https://ci-apps-arm.yunohost.org/ci/logs/jenkins%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/jenkins/)
|
||||
* Jessie x86-64b - [![](https://ci-stretch.nohost.me/ci/logs/jenkins%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/jenkins/)
|
||||
|
||||
## Limitations
|
||||
|
||||
* Can't be updated after the current version 2.46, because it need some packages not available on jessie.
|
||||
|
||||
## Additionnal informations
|
||||
|
||||
## Links
|
||||
|
@ -57,8 +54,7 @@ Supported, with LDAP and SSO.
|
|||
|
||||
---
|
||||
|
||||
Developers infos
|
||||
----------------
|
||||
## Developers infos
|
||||
|
||||
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/jenkins_ynh/tree/testing).
|
||||
|
||||
|
|
30
README_fr.md
30
README_fr.md
|
@ -1,17 +1,17 @@
|
|||
# Jenkins pour YunoHost
|
||||
|
||||
[![Niveau d'intégration](https://dash.yunohost.org/integration/jenkins.svg)](https://dash.yunohost.org/appci/app/jenkins) ![](https://ci-apps.yunohost.org/ci/badges/jenkins.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/jenkins.maintain.svg)
|
||||
[![Installer Jenkins avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=jenkins)
|
||||
[![Installer Jenkins avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=jenkins)
|
||||
|
||||
*[Read this readme in english.](./README.md)*
|
||||
|
||||
> *Ce package vous permet d'installer jenkins rapidement et simplement sur un serveur YunoHost.
|
||||
> *Ce package vous permet d'installer Jenkins rapidement et simplement sur un serveur YunoHost.
|
||||
Si vous n'avez pas YunoHost, merci de regarder [ici](https://yunohost.org/#/install_fr) pour savoir comment l'installer et en profiter.*
|
||||
|
||||
## Résumé
|
||||
## Vue d'ensemble
|
||||
Premier serveur d'automatisation open source, Jenkins fournit des centaines de plugins pour supporter la construction, le déploiement et l'automatisation de n'importe quel projet.
|
||||
|
||||
**Version embarquée:** 2.235.2
|
||||
**Version embarquée :** 2.263.1
|
||||
|
||||
## Captures d'écran
|
||||
|
||||
|
@ -23,12 +23,12 @@ Aucune démo pour cette application.
|
|||
|
||||
## Configuration
|
||||
|
||||
Utiliser le panneau d'administration de votre Jenkins pour configurer cette application.
|
||||
Utiliser le panneau d'administration de Jenkins pour configurer cette application.
|
||||
|
||||
## Documentation
|
||||
|
||||
* Documentation officielle: https://jenkins.io/doc/
|
||||
* Documentation YunoHost: Il n'y a pas d'autre documentation, n'hésitez pas à contribuer.
|
||||
* Documentation officielle : https://jenkins.io/doc/
|
||||
* Documentation YunoHost : Il n'y a pas d'autre documentation, n'hésitez pas à contribuer.
|
||||
|
||||
## Fonctionnalités spécifiques à YunoHost
|
||||
|
||||
|
@ -38,27 +38,23 @@ Supportée, avec LDAP et SSO.
|
|||
|
||||
#### Architectures supportées.
|
||||
|
||||
* x86-64b - [![](https://ci-apps.yunohost.org/ci/logs/jenkins%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/jenkins/)
|
||||
* x86-64 - [![](https://ci-apps.yunohost.org/ci/logs/jenkins%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/jenkins/)
|
||||
* ARMv8-A - [![](https://ci-apps-arm.yunohost.org/ci/logs/jenkins%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/jenkins/)
|
||||
* Jessie x86-64b - [![](https://ci-stretch.nohost.me/ci/logs/jenkins%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/jenkins/)
|
||||
|
||||
## Limitations
|
||||
|
||||
* Ne peut pas être mis à jour après la version actuelle 2.46, car il a besoin de certains paquets qui ne sont pas disponibles sur jessie.
|
||||
|
||||
## Informations additionnelles
|
||||
|
||||
## Liens
|
||||
|
||||
* Reporter un bug: https://github.com/YunoHost-Apps/jenkins_ynh/issues
|
||||
* Site de jenkins: https://jenkins.io
|
||||
* Dépôt git de jenkins: https://github.com/jenkinsci/jenkins
|
||||
* Site de YunoHost: https://yunohost.org/
|
||||
* Reporter un bug : https://github.com/YunoHost-Apps/jenkins_ynh/issues
|
||||
* Site de jenkins : https://jenkins.io
|
||||
* Dépôt git de Jenkins : https://github.com/jenkinsci/jenkins
|
||||
* Site de YunoHost : https://yunohost.org/
|
||||
|
||||
---
|
||||
|
||||
Informations à l'intention des développeurs
|
||||
----------------
|
||||
## Informations à l'intention des développeurs
|
||||
|
||||
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/jenkins_ynh/tree/testing).
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"name": "is_public",
|
||||
"type": "boolean",
|
||||
"ask": {
|
||||
"en": "Is it a public app ?"
|
||||
"en": "Is it a public app?"
|
||||
},
|
||||
"default": true
|
||||
}
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
incorrect_path=1
|
||||
port_already_use=1 (8080)
|
||||
change_url=1
|
||||
;;; Levels
|
||||
Level 5=auto
|
||||
;;; Options
|
||||
Email=
|
||||
Notification=down
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
SOURCE_URL=https://pkg.jenkins.io/debian-stable/binary/jenkins_2.235.2_all.deb
|
||||
SOURCE_SUM=536f5486831243337312e7995a10b993
|
||||
SOURCE_SUM_PRG=md5sum
|
||||
SOURCE_URL=https://pkg.jenkins.io/debian-stable/binary/jenkins_2.263.1_all.deb
|
||||
SOURCE_SUM=faae72cc486c3032be31d47ddcaa7bce77aba54ad6bb900ec73550f8096348ba
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=deb
|
||||
SOURCE_IN_SUBDIR=true
|
||||
SOURCE_FILENAME=jenkins.deb
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
"name": "Public access",
|
||||
"id": "is_public",
|
||||
"options": [{
|
||||
"name": "Is it a public app ?",
|
||||
"name": "Is it a public app?",
|
||||
"id": "is_public",
|
||||
"type": "bool",
|
||||
"default": true
|
||||
|
@ -18,7 +18,7 @@
|
|||
"name": "Overwriting config files",
|
||||
"id": "overwrite_files",
|
||||
"options": [{
|
||||
"name": "Overwrite the nginx config file ?",
|
||||
"name": "Overwrite the NGINX config file?",
|
||||
"help": "If the file is overwritten, a backup will be created.",
|
||||
"id": "overwrite_nginx",
|
||||
"type": "bool",
|
||||
|
@ -29,7 +29,7 @@
|
|||
"name": "Global configuration",
|
||||
"id": "global_config",
|
||||
"options": [{
|
||||
"name": "Send HTML email to admin ?",
|
||||
"name": "Send HTML email to admin?",
|
||||
"help": "Allow app scripts to send HTML mails instead of plain text.",
|
||||
"id": "email_type",
|
||||
"type": "bool",
|
||||
|
|
55
issue_template.md
Normal file
55
issue_template.md
Normal file
|
@ -0,0 +1,55 @@
|
|||
---
|
||||
name: Bug report
|
||||
about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently.
|
||||
|
||||
---
|
||||
|
||||
**How to post a meaningful bug report**
|
||||
1. *Read this whole template first.*
|
||||
2. *Determine if you are on the right place:*
|
||||
- *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!*
|
||||
- *Otherwise, the issue may be due to Jenkins itself. Refer to its documentation or repository for help.*
|
||||
- *When in doubt, post here and we will figure it out together.*
|
||||
3. *Delete the italic comments as you write over them below, and remove this guide.*
|
||||
---
|
||||
|
||||
### Describe the bug
|
||||
|
||||
*A clear and concise description of what the bug is.*
|
||||
|
||||
### Context
|
||||
|
||||
- Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...*
|
||||
- YunoHost version: x.x.x
|
||||
- I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...*
|
||||
- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes*
|
||||
- If yes, please explain:
|
||||
- Using, or trying to install package version/branch:
|
||||
- If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`*
|
||||
|
||||
### Steps to reproduce
|
||||
|
||||
- *If you performed a command from the CLI, the command itself is enough. For example:*
|
||||
```sh
|
||||
sudo yunohost app install jenkins
|
||||
```
|
||||
- *If you used the webadmin, please perform the equivalent command from the CLI first.*
|
||||
- *If the error occurs in your browser, explain what you did:*
|
||||
1. *Go to '...'*
|
||||
2. *Click on '...'*
|
||||
3. *Scroll down to '...'*
|
||||
4. *See error*
|
||||
|
||||
### Expected behavior
|
||||
|
||||
*A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.*
|
||||
|
||||
### Logs
|
||||
|
||||
*When an operation fails, YunoHost provides a simple way to share the logs.*
|
||||
- *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.*
|
||||
- *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.*
|
||||
|
||||
*After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)*
|
||||
|
||||
*If applicable and useful, add screenshots to help explain your problem.*
|
|
@ -6,7 +6,7 @@
|
|||
"en": "Extendable continuous integration server",
|
||||
"fr": "Serveur d'intégration continue extensible"
|
||||
},
|
||||
"version": "2.235.2~ynh1",
|
||||
"version": "2.263.1~ynh1",
|
||||
"url": "https://jenkins.io/index.html",
|
||||
"license": "MIT",
|
||||
"maintainer": {
|
||||
|
@ -18,7 +18,7 @@
|
|||
"email": "maniackc_dev@crudelis.fr"
|
||||
}],
|
||||
"requirements": {
|
||||
"yunohost": ">= 3.5.0"
|
||||
"yunohost": ">= 4.0.0"
|
||||
},
|
||||
"multi_instance": false,
|
||||
"services": [
|
||||
|
|
16
pull_request_template.md
Normal file
16
pull_request_template.md
Normal file
|
@ -0,0 +1,16 @@
|
|||
## Problem
|
||||
- *Description of why you made this PR*
|
||||
|
||||
## Solution
|
||||
- *And how do you fix that problem*
|
||||
|
||||
## PR Status
|
||||
- [ ] Code finished.
|
||||
- [ ] Tested with Package_check.
|
||||
- [ ] Fix or enhancement tested.
|
||||
- [ ] Upgrade from last version tested.
|
||||
- [ ] Can be reviewed and tested.
|
||||
|
||||
## Package_check results
|
||||
---
|
||||
* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"*
|
|
@ -1,31 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# COMMON VARIABLES
|
||||
#=================================================
|
||||
|
||||
app_depencencies="openjdk-11-jdk daemon net-tools"
|
||||
|
||||
#=================================================
|
||||
# PERSONAL HELPERS
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# BACKUP
|
||||
#=================================================
|
||||
|
||||
HUMAN_SIZE () { # Transforme une taille en Ko en une taille lisible pour un humain
|
||||
human=$(numfmt --to=iec --from-unit=1K $1)
|
||||
echo $human
|
||||
}
|
||||
|
||||
CHECK_SIZE () { # Vérifie avant chaque backup que l'espace est suffisant
|
||||
file_to_analyse=$1
|
||||
backup_size=$(du --summarize "$file_to_analyse" | cut -f1)
|
||||
free_space=$(df --output=avail "/home/yunohost.backup" | sed 1d)
|
||||
|
||||
if [ $free_space -le $backup_size ]
|
||||
then
|
||||
ynh_print_err "Espace insuffisant pour sauvegarder $file_to_analyse."
|
||||
ynh_print_err "Espace disponible: $(HUMAN_SIZE $free_space)"
|
||||
ynh_die "Espace nécessaire: $(HUMAN_SIZE $backup_size)"
|
||||
fi
|
||||
}
|
||||
|
||||
#=================================================
|
||||
# PACKAGE CHECK BYPASSING...
|
||||
#=================================================
|
||||
|
@ -69,7 +53,7 @@ ynh_multimedia_build_main_dir () {
|
|||
local checksum="806a827ba1902d6911095602a9221181"
|
||||
|
||||
# Download yunohost.multimedia scripts
|
||||
wget -nv https://github.com/YunoHost-Apps/yunohost.multimedia/archive/${ynh_media_release}.tar.gz
|
||||
wget -nv https://github.com/YunoHost-Apps/yunohost.multimedia/archive/${ynh_media_release}.tar.gz 2>&1
|
||||
|
||||
# Check the control sum
|
||||
echo "${checksum} ${ynh_media_release}.tar.gz" | md5sum -c --status \
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Dependencies
|
||||
app_depencencies="default-jre-headless daemon net-tools"
|
|
@ -1,148 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
#
|
||||
# The file conf/app.src need to contains:
|
||||
#
|
||||
# SOURCE_URL=Address to download the app archive
|
||||
# SOURCE_SUM=Control sum
|
||||
# # (Optional) Program to check the integrity (sha256sum, md5sum...)
|
||||
# # default: sha256
|
||||
# SOURCE_SUM_PRG=sha256
|
||||
# # (Optional) Archive format
|
||||
# # default: tar.gz
|
||||
# SOURCE_FORMAT=tar.gz
|
||||
# # (Optional) Put false if sources are directly in the archive root
|
||||
# # default: true
|
||||
# # Instead of true, SOURCE_IN_SUBDIR could be the number of sub directories
|
||||
# # to remove.
|
||||
# SOURCE_IN_SUBDIR=false
|
||||
# # (Optionnal) Name of the local archive (offline setup support)
|
||||
# # default: ${src_id}.${src_format}
|
||||
# SOURCE_FILENAME=example.tar.gz
|
||||
# # (Optional) If it set as false don't extract the source.
|
||||
# # (Useful to get a debian package or a python wheel.)
|
||||
# # default: true
|
||||
# SOURCE_EXTRACT=(true|false)
|
||||
#
|
||||
# Details:
|
||||
# This helper downloads sources from SOURCE_URL if there is no local source
|
||||
# archive in /opt/yunohost-apps-src/APP_ID/SOURCE_FILENAME
|
||||
#
|
||||
# Next, it checks the integrity with "SOURCE_SUM_PRG -c --status" command.
|
||||
#
|
||||
# If it's ok, the source archive will be uncompressed in $dest_dir. If the
|
||||
# SOURCE_IN_SUBDIR is true, the first level directory of the archive will be
|
||||
# removed.
|
||||
# If SOURCE_IN_SUBDIR is a numeric value, 2 for example, the 2 first level
|
||||
# directories will be removed
|
||||
#
|
||||
# Finally, patches named sources/patches/${src_id}-*.patch and extra files in
|
||||
# sources/extra_files/$src_id will be applied to dest_dir
|
||||
#
|
||||
#
|
||||
# usage: ynh_setup_source --dest_dir=dest_dir [--source_id=source_id]
|
||||
# | arg: -d, --dest_dir - Directory where to setup sources
|
||||
# | arg: -s, --source_id - Name of the app, if the package contains more than one app
|
||||
#
|
||||
# Requires YunoHost version 2.6.4 or higher.
|
||||
ynh_setup_source () {
|
||||
# Declare an array to define the options of this helper.
|
||||
local legacy_args=ds
|
||||
declare -Ar args_array=( [d]=dest_dir= [s]=source_id= )
|
||||
local dest_dir
|
||||
local source_id
|
||||
# Manage arguments with getopts
|
||||
ynh_handle_getopts_args "$@"
|
||||
source_id="${source_id:-app}" # If the argument is not given, source_id equals "app"
|
||||
|
||||
local src_file_path="$YNH_CWD/../conf/${source_id}.src"
|
||||
# In case of restore script the src file is in an other path.
|
||||
# So try to use the restore path if the general path point to no file.
|
||||
if [ ! -e "$src_file_path" ]; then
|
||||
src_file_path="$YNH_CWD/../settings/conf/${source_id}.src"
|
||||
fi
|
||||
|
||||
# Load value from configuration file (see above for a small doc about this file
|
||||
# format)
|
||||
local src_url=$(grep 'SOURCE_URL=' "$src_file_path" | cut -d= -f2-)
|
||||
local src_sum=$(grep 'SOURCE_SUM=' "$src_file_path" | cut -d= -f2-)
|
||||
local src_sumprg=$(grep 'SOURCE_SUM_PRG=' "$src_file_path" | cut -d= -f2-)
|
||||
local src_format=$(grep 'SOURCE_FORMAT=' "$src_file_path" | cut -d= -f2-)
|
||||
local src_extract=$(grep 'SOURCE_EXTRACT=' "$src_file_path" | cut -d= -f2-)
|
||||
local src_in_subdir=$(grep 'SOURCE_IN_SUBDIR=' "$src_file_path" | cut -d= -f2-)
|
||||
local src_filename=$(grep 'SOURCE_FILENAME=' "$src_file_path" | cut -d= -f2-)
|
||||
|
||||
# Default value
|
||||
src_sumprg=${src_sumprg:-sha256sum}
|
||||
src_in_subdir=${src_in_subdir:-true}
|
||||
src_format=${src_format:-tar.gz}
|
||||
src_format=$(echo "$src_format" | tr '[:upper:]' '[:lower:]')
|
||||
src_extract=${src_extract:-true}
|
||||
if [ "$src_filename" = "" ] ; then
|
||||
src_filename="${source_id}.${src_format}"
|
||||
fi
|
||||
local local_src="/opt/yunohost-apps-src/${YNH_APP_ID}/${src_filename}"
|
||||
|
||||
if test -e "$local_src"
|
||||
then # Use the local source file if it is present
|
||||
cp $local_src $src_filename
|
||||
else # If not, download the source
|
||||
local out=`wget -nv -O $src_filename $src_url 2>&1` || ynh_print_err --message="$out"
|
||||
fi
|
||||
|
||||
# Check the control sum
|
||||
echo "${src_sum} ${src_filename}" | ${src_sumprg} -c --status \
|
||||
|| ynh_die --message="Corrupt source"
|
||||
|
||||
# Extract source into the app dir
|
||||
mkdir -p "$dest_dir"
|
||||
|
||||
if ! "$src_extract"
|
||||
then
|
||||
mv $src_filename $dest_dir
|
||||
elif [ "$src_format" = "zip" ]
|
||||
then
|
||||
# Zip format
|
||||
# Using of a temp directory, because unzip doesn't manage --strip-components
|
||||
if $src_in_subdir ; then
|
||||
local tmp_dir=$(mktemp -d)
|
||||
unzip -quo $src_filename -d "$tmp_dir"
|
||||
cp -a $tmp_dir/*/. "$dest_dir"
|
||||
ynh_secure_remove --file="$tmp_dir"
|
||||
else
|
||||
unzip -quo $src_filename -d "$dest_dir"
|
||||
fi
|
||||
else
|
||||
local strip=""
|
||||
if [ "$src_in_subdir" != "false" ]
|
||||
then
|
||||
if [ "$src_in_subdir" == "true" ]; then
|
||||
local sub_dirs=1
|
||||
else
|
||||
local sub_dirs="$src_in_subdir"
|
||||
fi
|
||||
strip="--strip-components $sub_dirs"
|
||||
fi
|
||||
if [[ "$src_format" =~ ^tar.gz|tar.bz2|tar.xz$ ]] ; then
|
||||
tar -xf $src_filename -C "$dest_dir" $strip
|
||||
else
|
||||
ynh_die --message="Archive format unrecognized."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Apply patches
|
||||
if (( $(find $YNH_CWD/../sources/patches/ -type f -name "${source_id}-*.patch" 2> /dev/null | wc -l) > "0" )); then
|
||||
local old_dir=$(pwd)
|
||||
(cd "$dest_dir" \
|
||||
&& for p in $YNH_CWD/../sources/patches/${source_id}-*.patch; do \
|
||||
patch -p1 < $p; done) \
|
||||
|| ynh_die --message="Unable to apply patches"
|
||||
cd $old_dir
|
||||
fi
|
||||
|
||||
# Add supplementary files
|
||||
if test -e "$YNH_CWD/../sources/extra_files/${source_id}"; then
|
||||
cp -a $YNH_CWD/../sources/extra_files/$source_id/. "$dest_dir"
|
||||
fi
|
||||
}
|
|
@ -22,7 +22,7 @@ ynh_abort_if_errors
|
|||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading installation settings..." --weight=3
|
||||
ynh_print_info --message="Loading installation settings..."
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
|
@ -30,22 +30,19 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
|
||||
#=================================================
|
||||
# STANDARD BACKUP STEPS
|
||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||
#=================================================
|
||||
ynh_print_info --message="Declaring files to be backed up..."
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE APP MAIN DIR
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the main app directory..." --weight=15
|
||||
|
||||
ynh_systemd_action --action=stop --service_name=jenkins
|
||||
sleep 1
|
||||
|
||||
CHECK_SIZE "$final_path"
|
||||
ynh_backup --src_path="$final_path"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up nginx web server configuration..."
|
||||
|
||||
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
|
@ -57,16 +54,8 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|||
|
||||
ynh_backup --src_path=/etc/default/$app
|
||||
|
||||
#=================================================
|
||||
# CHECK JENKINS STARTING
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restarting Jenkins..." --weight=20
|
||||
|
||||
# Wait for Jenkins to be fully started
|
||||
ynh_systemd_action --line_match="Jenkins is fully up and running" --log_path="/var/log/$app/$app.log" --timeout="300"
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last
|
||||
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|
||||
|
|
|
@ -68,28 +68,28 @@ ynh_abort_if_errors
|
|||
#=================================================
|
||||
# MODIFY URL IN NGINX CONF
|
||||
#=================================================
|
||||
ynh_script_progression --message="Updating nginx web server configuration..." --weight=5
|
||||
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=5
|
||||
|
||||
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
||||
|
||||
# Change the path in the nginx config file
|
||||
# Change the path in the NGINX config file
|
||||
if [ $change_path -eq 1 ]
|
||||
then
|
||||
# Make a backup of the original nginx config file if modified
|
||||
# Make a backup of the original NGINX config file if modified
|
||||
ynh_backup_if_checksum_is_different --file="$nginx_conf_path"
|
||||
|
||||
# Set global variables for nginx helper
|
||||
# Set global variables for NGINX helper
|
||||
domain="$old_domain"
|
||||
path_url="$new_path"
|
||||
|
||||
# Store path_url setting
|
||||
ynh_app_setting_set --app=$app --key=path_url --value="$path_url"
|
||||
|
||||
# Create a dedicated nginx config
|
||||
# Create a dedicated NGINX config
|
||||
ynh_add_nginx_config
|
||||
fi
|
||||
|
||||
# Change the domain for nginx
|
||||
# Change the domain for NGINX
|
||||
if [ $change_domain -eq 1 ]
|
||||
then
|
||||
# Delete file checksum for the old conf file location
|
||||
|
@ -105,7 +105,7 @@ fi
|
|||
#=================================================
|
||||
# MODIFY JENKINS SETUP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Updating jenkins setup..."
|
||||
ynh_script_progression --message="Updating Jenkins setup..."
|
||||
|
||||
if [ $change_path -eq 1 ]
|
||||
then
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
# Load common variables for all scripts.
|
||||
source _variables
|
||||
|
||||
#=================================================
|
||||
# RETRIEVE ARGUMENTS
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
# Load common variables for all scripts.
|
||||
source _variables
|
||||
|
||||
#=================================================
|
||||
# MANAGE FAILURE OF THE SCRIPT
|
||||
|
@ -66,7 +64,7 @@ ynh_app_setting_set --app=$app --key=admin_mail_html --value=1
|
|||
#=================================================
|
||||
# FIND AND OPEN A PORT
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring firewall..." --weight=2
|
||||
ynh_script_progression --message="Finding an available port..." --weight=2
|
||||
|
||||
# Find a free port
|
||||
port=$(ynh_find_port --port=8080)
|
||||
|
@ -82,9 +80,9 @@ ynh_install_app_dependencies $app_depencencies
|
|||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring nginx web server..." --weight=2
|
||||
ynh_script_progression --message="Configuring NGINX web server..." --weight=2
|
||||
|
||||
# Create a dedicated nginx config
|
||||
# Create a dedicated NGINX config
|
||||
ynh_add_nginx_config
|
||||
|
||||
#=================================================
|
||||
|
@ -150,7 +148,7 @@ yunohost app ssowatconf
|
|||
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||
#=================================================
|
||||
|
||||
yunohost service add $app --log /var/log/$app/$app.log
|
||||
yunohost service add $app --log=/var/log/$app/$app.log
|
||||
|
||||
#=================================================
|
||||
# CHECK JENKINS STARTING
|
||||
|
@ -175,7 +173,7 @@ ynh_systemd_action --action=restart --line_match="Jenkins is fully up and runnin
|
|||
ynh_script_progression --message="Installing plugins..." --weight=60
|
||||
|
||||
# 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 2>&1
|
||||
for i in `seq 1 $timeout`
|
||||
do
|
||||
# Wait for an update of plugin repositories
|
||||
|
|
|
@ -24,10 +24,10 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|||
# REMOVE SERVICE FROM ADMIN PANEL
|
||||
#=================================================
|
||||
|
||||
# Check if the service is declared in YunoHost
|
||||
if yunohost service status $app >/dev/null 2>&1
|
||||
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
|
||||
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
||||
then
|
||||
ynh_script_progression --message="Removing $app service..."
|
||||
ynh_script_progression --message="Removing $app service integration..." --weight=1
|
||||
yunohost service remove $app
|
||||
fi
|
||||
|
||||
|
@ -44,9 +44,9 @@ ynh_secure_remove --file="/var/lib/jenkins"
|
|||
#=================================================
|
||||
# REMOVE THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing nginx web server configuration..." --weight=2
|
||||
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=2
|
||||
|
||||
# Remove the dedicated nginx config
|
||||
# Remove the dedicated NGINX config
|
||||
ynh_remove_nginx_config
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -8,11 +8,6 @@
|
|||
|
||||
source ../settings/scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
# Load common variables for all scripts.
|
||||
source ../settings/scripts/_variables
|
||||
|
||||
# Source the version 3.6 of ynh_setup_source which allow this helper to be used in restore script
|
||||
source ../settings/scripts/_ynh_setup_source_fix.sh
|
||||
|
||||
#=================================================
|
||||
# MANAGE SCRIPT FAILURE
|
||||
|
@ -123,7 +118,7 @@ ynh_restore_file --origin_path=/etc/default/$app
|
|||
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||
#=================================================
|
||||
|
||||
yunohost service add $app --log "/var/log/$app/$app.log"
|
||||
yunohost service add $app --log="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# CHECK JENKINS STARTING
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
# Load common variables for all scripts.
|
||||
source _variables
|
||||
|
||||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
|
@ -33,7 +31,7 @@ upgrade_type=$(ynh_check_app_version_changed)
|
|||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Ensuring downward compatibility..."
|
||||
ynh_script_progression --message="Ensuring downward compatibility..." --weight=2
|
||||
|
||||
# Fix is_public as a boolean
|
||||
if [ "$is_public" = "Yes" ]; then
|
||||
|
@ -122,9 +120,9 @@ ynh_install_app_dependencies $app_depencencies
|
|||
# Overwrite the nginx configuration only if it's allowed
|
||||
if [ $overwrite_nginx -eq 1 ]
|
||||
then
|
||||
ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=4
|
||||
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=4
|
||||
|
||||
# Create a dedicated nginx config
|
||||
# Create a dedicated NGINX config
|
||||
ynh_add_nginx_config
|
||||
fi
|
||||
|
||||
|
@ -143,7 +141,7 @@ fi
|
|||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading nginx web server..." --weight=2
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=2
|
||||
|
||||
ynh_systemd_action --action=reload --service_name=nginx
|
||||
|
||||
|
@ -167,7 +165,7 @@ ynh_maintenance_mode_OFF
|
|||
#=================================================
|
||||
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 2>&1
|
||||
|
||||
#=================================================
|
||||
# UPGRADE PLUGINS
|
||||
|
@ -190,6 +188,12 @@ done
|
|||
mv /var/lib/jenkins/config.xml.bak /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"
|
||||
|
||||
#=================================================
|
||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||
#=================================================
|
||||
|
||||
yunohost service add $app --log=/var/log/$app/$app.log
|
||||
|
||||
#=================================================
|
||||
# SEND A README FOR THE ADMIN
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue