mirror of
https://github.com/YunoHost/apps.git
synced 2024-09-03 20:06:07 +02:00
v0.8.1
This commit is contained in:
parent
c55c8a7396
commit
5fbe1c2bb5
15 changed files with 208 additions and 29 deletions
3
tools/app_generator/templates/ADMIN.j2
Normal file
3
tools/app_generator/templates/ADMIN.j2
Normal file
|
@ -0,0 +1,3 @@
|
|||
This is a dummy admin doc for this app
|
||||
|
||||
The app install dir is `__INSTALL_DIR__`
|
1
tools/app_generator/templates/DESCRIPTION.j2
Normal file
1
tools/app_generator/templates/DESCRIPTION.j2
Normal file
|
@ -0,0 +1 @@
|
|||
This is a dummy description of this app features
|
1
tools/app_generator/templates/DISCLAIMER.j2
Normal file
1
tools/app_generator/templates/DISCLAIMER.j2
Normal file
|
@ -0,0 +1 @@
|
|||
This is a dummy disclaimer that will be added to the README.MD of your app.
|
7
tools/app_generator/templates/POST_INSTALL.j2
Normal file
7
tools/app_generator/templates/POST_INSTALL.j2
Normal file
|
@ -0,0 +1,7 @@
|
|||
This is a dummy disclaimer to display after the install
|
||||
|
||||
The app url is <https://__DOMAIN____PATH__>
|
||||
|
||||
The app install dir is `__INSTALL_DIR__`
|
||||
|
||||
The app id is `__ID__`
|
1
tools/app_generator/templates/POST_UPGRADE.j2
Normal file
1
tools/app_generator/templates/POST_UPGRADE.j2
Normal file
|
@ -0,0 +1 @@
|
|||
This is a dummy disclaimer to display after upgrades
|
1
tools/app_generator/templates/PRE_INSTALL.j2
Normal file
1
tools/app_generator/templates/PRE_INSTALL.j2
Normal file
|
@ -0,0 +1 @@
|
|||
This is a dummy disclaimer to display prior to the install
|
1
tools/app_generator/templates/PRE_UPGRADE.j2
Normal file
1
tools/app_generator/templates/PRE_UPGRADE.j2
Normal file
|
@ -0,0 +1 @@
|
|||
This is a dummy disclaimer to display prior to any upgrade
|
|
@ -1,5 +1,6 @@
|
|||
#!/bin/bash
|
||||
#### App file generated with YoloGen, the YunoHost app generator, version {{ data.GENERATOR_VERSION }}.
|
||||
#### App file generated with YoloGen, the YunoHost app generator, version {{ data['GENERATOR_VERSION'] }}.
|
||||
|
||||
{% if data.generator_mode == 'tutorial' -%} # This is the tutorial version of the app.
|
||||
# It contains extra commands to explain what should be done in case you want to adjust some part of the script.
|
||||
# Once you are done, you may remove them.
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash
|
||||
### App file generated with YoloGen, the Yunohost app generator, version {{ data['GENERATOR_VERSION'] }}.
|
||||
|
||||
{% if data.generator_mode == 'tutorial' -%}
|
||||
# This is the tutorial version of the app.
|
||||
|
|
|
@ -30,9 +30,11 @@ YunoHost app generator
|
|||
<link rel="stylesheet" href="{{url_for('.static', filename='stylesheet.css')}}">
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
<div class="container" style="max-width: 800px;">
|
||||
<h1 class="message text-center">Formulaire de génération d'une application Yunohost</h1>
|
||||
<p style="text-align: center; margin-left:5%">Version: {{ generator_info['GENERATOR_VERSION'] }}</p>
|
||||
|
||||
<form id="main-form" class="form form-horizontal" method="POST" role="form">
|
||||
{{ main_form.hidden_tag() }}
|
||||
|
@ -42,11 +44,12 @@ YunoHost app generator
|
|||
|
||||
{{ form_field(main_form.generator_mode) }}
|
||||
|
||||
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h2 class="panel-title">1/8 - Informations générales</h2>
|
||||
<div class="panel-heading collapse-button">
|
||||
<h2 class="panel-title collapse-title">1/9 - Informations générales</h2>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="panel-body collapsible collapsed">
|
||||
<div>
|
||||
{{ form_field(main_form.app_name) }}
|
||||
{{ form_field(main_form.app_id) }}
|
||||
|
@ -58,10 +61,10 @@ YunoHost app generator
|
|||
|
||||
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h2 class="panel-title">2/8 - Informations sur l'upstream</h2>
|
||||
<div class="panel-heading collapse-button">
|
||||
<h2 class="panel-title collapse-title">2/9 - Informations sur le projet upstream de l'application</h2>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="panel-body collapsible collapsed">
|
||||
<p><i>Le terme upstream désigne le projet original qui maintient l'app</i></p>
|
||||
<div>
|
||||
{{ form_field(main_form.license) }}
|
||||
|
@ -74,11 +77,12 @@ YunoHost app generator
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h2 class="panel-title">3/8 - Intégration dans YunoHost</h2>
|
||||
<div class="panel-heading collapse-button">
|
||||
<h2 class="panel-title collapse-title">3/9 - Intégration dans YunoHost</h2>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="panel-body collapsible collapsed">
|
||||
<div>
|
||||
{{ form_field(main_form.version) }}
|
||||
{{ form_field(main_form.maintainers) }}
|
||||
|
@ -91,10 +95,10 @@ YunoHost app generator
|
|||
</div>
|
||||
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h2 class="panel-title">4/8 - Questions à poser pendant l'installation</h2>
|
||||
<div class="panel-heading collapse-button">
|
||||
<h2 class="panel-title collapse-title">4/9 - Questions à poser pendant l'installation</h2>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="panel-body collapsible collapsed">
|
||||
<p>
|
||||
<em>Cette partie sert à indiquer les questions qui devront être posées.</em>
|
||||
<br/>
|
||||
|
@ -112,10 +116,10 @@ YunoHost app generator
|
|||
</div>
|
||||
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h2 class="panel-title">5/8 - Ressources à initialiser</h2>
|
||||
<div class="panel-heading collapse-button">
|
||||
<h2 class="panel-title collapse-title">5/9 - Ressources à initialiser</h2>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="panel-body collapsible collapsed">
|
||||
<p>
|
||||
<em>Il s'agit d'éléments techniques configurés avant que le "vrai" script d'install de l'app ne soit lancé. Typiquement : créer un user système, télécharger les sources de l'app, initialiser le dossier d'install et de données, installer des dépendances avec apt, créer une base de donnée SQL, ...</em>
|
||||
</p>
|
||||
|
@ -139,10 +143,10 @@ YunoHost app generator
|
|||
</div>
|
||||
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h2 class="panel-title">6/8 - Technologie spécifique</h2>
|
||||
<div class="panel-heading collapse-button">
|
||||
<h2 class="panel-title collapse-title">6/9 - Technologie spécifique</h2>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="panel-body collapsible collapsed">
|
||||
{{ form_field(main_form.main_technology) }}
|
||||
<div id="php_options">
|
||||
<div class="alert alert-info" role="alert"><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span> You probably want to make sure to have 'phpX.Y-fpm' and others 'phpX.Y-foobar' libraries listed the apt dependencies earlier (with X.Y being the php version you want to use)</div>
|
||||
|
@ -219,10 +223,10 @@ YunoHost app generator
|
|||
</div>
|
||||
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h2 class="panel-title">7/8 - Configuration de l'app</h2>
|
||||
<div class="panel-heading collapse-button">
|
||||
<h2 class="panel-title collapse-title">7/9 - Configuration de l'app</h2>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="panel-body collapsible collapsed">
|
||||
{{ form_field(main_form.use_custom_config_file) }}
|
||||
<!-- TODO : this show/hide the other fields -->
|
||||
<div id="custom_config_file_options">
|
||||
|
@ -243,10 +247,30 @@ YunoHost app generator
|
|||
</div>
|
||||
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h2 class="panel-title">8/8 - Options avancées</h2>
|
||||
<div class="panel-heading collapse-button">
|
||||
<h2 class="panel-title collapse-title">8/9 - Documentation générale et avancée</h2>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="panel-body collapsible collapsed">
|
||||
<p><i>Une présentation plus complète que le résumé remplit plus haut de ce à quoi correspond le logiciel, et les avertissements et précisions éventuelles sur son fonctionnement dans Yunohost (c'est l'endroit où l'on signale des problèmes d'intégrations).</i></p>
|
||||
{{ form_field(main_form.description) }}
|
||||
{{ form_field(main_form.disclaimer) }}
|
||||
|
||||
<p><i>Des indications à afficher à des étapes clés de gestion du paquet: installation, mise à jour, message au compte admin. Vous n'avez généralement pas besoin de les remplir.</i></p>
|
||||
{{ form_field(main_form.pre_install) }}
|
||||
{{ form_field(main_form.post_install) }}
|
||||
{{ form_field(main_form.pre_upgrade) }}
|
||||
{{ form_field(main_form.post_upgrade) }}
|
||||
{{ form_field(main_form.admin) }}
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading collapse-button">
|
||||
<h2 class="panel-title collapse-title">9/9 - Options avancées</h2>
|
||||
</div>
|
||||
<div class="panel-body collapsible collapsed">
|
||||
{{ form_field(main_form.enable_change_url) }}
|
||||
{{ form_field(main_form.use_logrotate) }}
|
||||
{{ form_field(main_form.use_fail2ban) }}
|
||||
|
@ -257,9 +281,33 @@ YunoHost app generator
|
|||
</div>
|
||||
|
||||
<!-- Submit button -->
|
||||
<div class="text-center">
|
||||
<p class="text-center">
|
||||
{{ main_form.submit_preview(class="btn btn-primary") }}
|
||||
{{ main_form.submit_download(class="btn btn-primary") }}
|
||||
</p>
|
||||
|
||||
<!-- Submit button for demo values-->
|
||||
<script>
|
||||
function fillFormWithDefaultValues() {
|
||||
console.log("Filling the form with minimal dummy values")
|
||||
document.getElementById('app_id').value = "awesome_app_demo"
|
||||
document.getElementById('app_name').value = "Awesome demo app"
|
||||
document.getElementById('description_en').value = "Dummy app to demonstrate Yunohost app generator"
|
||||
document.getElementById('description_fr').value = "Application factice de démonstration du générateur d'application Yunohost"
|
||||
document.getElementById('version').value = "1.0~ynh1"
|
||||
document.getElementById('architectures').value = "all"
|
||||
// document.getElementById('ldap').value = "not_relevant"
|
||||
// document.getElementById('sso').value = "not_relevant"
|
||||
document.getElementById('license').value = "AGPL-3.0"
|
||||
document.getElementById('code').value = "https://github.com/YunoHost/example_ynh/"
|
||||
document.getElementById('source_url').value = "https://github.com/YunoHost/example_ynh/archive/1235ae57a3a285a4024d028d860f56980fa5ed19.tar.gz"
|
||||
document.getElementById('sha256sum').value = "471ff03ae251812d3d042fb7e9206c812de5bf07bd4ac4c95763278702eff30a" }
|
||||
</script>
|
||||
<p class="text-center">
|
||||
{{ main_form.submit_demo(class="btn btn-primary") }}
|
||||
</p>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
@ -270,10 +318,10 @@ YunoHost app generator
|
|||
<h2>Code généré</h1>
|
||||
{% for file in generated_files %}
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">{{ file.destination_path }}</h3>
|
||||
<div class="panel-heading collapse-button">
|
||||
<h3 class="panel-title collapse-title">{{ file.destination_path }}</h3>
|
||||
</div>
|
||||
<div class="panel-body" style="padding: 0;">
|
||||
<div class="panel-body collapsible collapsed" style="padding: 0;">
|
||||
<pre style="margin:0;">{{ file.content }}</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -281,4 +329,32 @@ YunoHost app generator
|
|||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var coll = document.getElementsByClassName("collapse-button");
|
||||
var i;
|
||||
|
||||
for (i = 0; i < coll.length; i++) {
|
||||
coll[i].addEventListener("click", function() {
|
||||
|
||||
if (this.classList.contains('expanded')) {
|
||||
this.classList.remove('expanded');
|
||||
this.nextElementSibling.classList.add('collapsed');
|
||||
} else {
|
||||
this.classList.add('expanded');
|
||||
this.nextElementSibling.classList.remove('collapsed');
|
||||
}
|
||||
|
||||
this.classList.toggle("active");
|
||||
var content = this.nextElementSibling;
|
||||
if (content.style.maxHeight){
|
||||
content.style.maxHeight = null;
|
||||
} else {
|
||||
content.style.maxHeight = content.scrollHeight + "px";
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash
|
||||
### App file generated with YoloGen, the Yunohost app generator, version {{ data['GENERATOR_VERSION'] }}.
|
||||
|
||||
{% if data.generator_mode == 'tutorial' -%}
|
||||
# This is the tutorial version of the app.
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash
|
||||
### App file generated with YoloGen, the Yunohost app generator, version {{ data['GENERATOR_VERSION'] }}.
|
||||
|
||||
{% if data.generator_mode == 'tutorial' -%} # This is the tutorial version of the app.
|
||||
# It contains extra commands to explain what should be done in case you want to adjust some part of the script.
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash
|
||||
### App file generated with YoloGen, the Yunohost app generator, version {{ data['GENERATOR_VERSION'] }}.
|
||||
|
||||
{% if data.generator_mode == 'tutorial' -%} # This is the tutorial version of the app.
|
||||
# It contains extra commands to explain what should be done in case you want to adjust some part of the script.
|
||||
|
|
82
tools/app_generator/templates/tests.j2
Normal file
82
tools/app_generator/templates/tests.j2
Normal file
|
@ -0,0 +1,82 @@
|
|||
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json
|
||||
|
||||
test_format = 1.0
|
||||
|
||||
[default]
|
||||
|
||||
# ------------
|
||||
# Tests to run
|
||||
# ------------
|
||||
|
||||
{% if data.generator_mode == "tutorial" -%}
|
||||
# -------------------------------------------------------------------------------
|
||||
# EVERYTHING PAST THIS POINT IS OPTIONAL AND MOST LIKELY UNNECESSARY FOR NEW APPS
|
||||
#--------------------------------------------------------------------------------
|
||||
## Conventions in this sample:
|
||||
## <- An actual comment
|
||||
# <- uncommenting this should be a valid entry in 'tests.toml'
|
||||
|
||||
## NB: the tests to run are automatically deduced by the CI script according to the
|
||||
## content of the app's manifest. The declarations below allow to customize which
|
||||
## tests are ran, possibly add special test suite to test special args, or
|
||||
## declare which commits to test upgrade from.
|
||||
##
|
||||
## You can also decide (though this is discouraged!) to ban/ignore some tests,
|
||||
## The test IDs to be used in only/exclude statements are:
|
||||
## * install.root
|
||||
## * install.subdir
|
||||
## * install.nourl
|
||||
## * install.multi
|
||||
## * backup_restore
|
||||
## * upgrade
|
||||
## * upgrade.someCommitId
|
||||
## * change_url
|
||||
## NB: you should NOT need this except if you really have a good reason...
|
||||
|
||||
# exclude = ["install.private", "install.multi"]
|
||||
|
||||
## For special usecases, sometimes you need to setup other things on the machine
|
||||
## prior to installing the app (such as installing another app)
|
||||
## (Remove this key entirely if not needed)
|
||||
|
||||
# preinstall = """
|
||||
# sudo yunohost app install foobar
|
||||
# sudo yunohost user list
|
||||
# """
|
||||
|
||||
# -------------------------------
|
||||
# Default args to use for install
|
||||
# -------------------------------
|
||||
|
||||
## By default, the CI will automagically fill the 'standard' args
|
||||
## such as domain, path, admin, is_public and password with relevant values
|
||||
## and also install args with a "default" provided in the manifest..
|
||||
## It should only make sense to declare custom args here for args with no default values
|
||||
## NB: you should NOT need those lines unless for custom questions with no obvious/default value
|
||||
|
||||
# args.language = "fr_FR"
|
||||
# args.multisite = 0
|
||||
|
||||
# -------------------------------
|
||||
# Commits to test upgrade from
|
||||
# -------------------------------
|
||||
|
||||
## 00a1a6e7 is part of commit SHA, preferrably from 'master' branch
|
||||
## that points to valid install of previous version
|
||||
|
||||
# test_upgrade_from.00a1a6e7.name = "Upgrade from 5.4"
|
||||
# test_upgrade_from.00a1a6e7.args.foo = "bar"
|
||||
|
||||
|
||||
## This is an additional test suite
|
||||
# [some_additional_testsuite]
|
||||
|
||||
## On additional tests suites, you can decide to run only specific tests
|
||||
|
||||
# only = ["install.subdir"]
|
||||
|
||||
# args.language = "en_GB"
|
||||
# args.multisite = 1
|
||||
|
||||
|
||||
{% endif -%}
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash
|
||||
### App file generated with YoloGen, the Yunohost app generator, version {{ data['GENERATOR_VERSION'] }}.
|
||||
|
||||
{% if data.generator_mode == 'tutorial' -%} # This is the tutorial version of the app.
|
||||
# It contains extra commands to explain what should be done in case you want to adjust some part of the script.
|
||||
|
|
Loading…
Add table
Reference in a new issue