chore : import initial du package veille-ia-gen_ynh (packaging v2, helpers 2.1)

Extrait du dépôt veille-ia-gen (socle phase 0).
manifest validé contre le schéma officiel manifest.v2.schema.json ;
sha256 de l'archive sources en placeholder jusqu'à la release v0.1.0.
This commit is contained in:
cyber-mawonaj
2026-08-01 09:44:31 -04:00
commit c6caa5024f
16 changed files with 466 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
#!/bin/bash
# Variables et fonctions communes aux scripts du package veille-ia_ynh.
# Normalise le chemin YNH pour paths.base de SvelteKit ("/" -> "" ; sinon "/veille").
veille_ia_base_path() {
if [ "$path" = "/" ]; then
echo ""
else
echo "$path"
fi
}
# Installe les dépendances, build l'app (avec le bon sous-chemin), puis élague
# les devDependencies pour ne garder que le runtime.
veille_ia_build_app() {
pushd "$install_dir/app"
ynh_hide_warnings ynh_exec_as_app npm ci
ynh_hide_warnings ynh_exec_as_app env BASE_PATH="$(veille_ia_base_path)" npm run build
ynh_hide_warnings ynh_exec_as_app npm prune --omit=dev
popd
}
# (Re)génère le fichier d'environnement applicatif et verrouille ses droits.
veille_ia_write_env() {
ynh_config_add --template="env" --destination="$install_dir/app/.env"
chmod 400 "$install_dir/app/.env"
chown "$app:$app" "$install_dir/app/.env"
}