Remove composer helper
This commit is contained in:
parent
6231ad2c49
commit
11243faa80
3 changed files with 6 additions and 73 deletions
|
@ -1,15 +1,12 @@
|
||||||
# See here for more informations
|
|
||||||
# https://github.com/YunoHost/package_check#syntax-check_process-file
|
|
||||||
|
|
||||||
;; Test complet
|
;; Test complet
|
||||||
; Manifest
|
; Manifest
|
||||||
domain="domain.tld" (DOMAIN)
|
domain="domain.tld"
|
||||||
path="/pterodactyl" (PATH)
|
path="/pterodactyl"
|
||||||
is_public=1 (PUBLIC|public=1|private=0)
|
is_public=1
|
||||||
language="fr"
|
language="fr"
|
||||||
password="pass"
|
password="pass"
|
||||||
admin="john" (USER)
|
admin="john"
|
||||||
port="9980" (PORT)
|
port="9980"
|
||||||
; Checks
|
; Checks
|
||||||
pkg_linter=1
|
pkg_linter=1
|
||||||
setup_sub_dir=1
|
setup_sub_dir=1
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
"email": "aeris@e.email"
|
"email": "aeris@e.email"
|
||||||
},
|
},
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">= 4.1.7"
|
"yunohost": ">= 4.2.4"
|
||||||
},
|
},
|
||||||
"multi_instance": true,
|
"multi_instance": true,
|
||||||
"services": [
|
"services": [
|
||||||
|
@ -26,29 +26,17 @@
|
||||||
"install": [{
|
"install": [{
|
||||||
"name": "domain",
|
"name": "domain",
|
||||||
"type": "domain",
|
"type": "domain",
|
||||||
"ask": {
|
|
||||||
"en": "Choose a domain name for Pterodactyl",
|
|
||||||
"fr": "Choisissez un nom de domaine pour Pterodactyl"
|
|
||||||
},
|
|
||||||
"example": "example.com"
|
"example": "example.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "path",
|
"name": "path",
|
||||||
"type": "path",
|
"type": "path",
|
||||||
"ask": {
|
|
||||||
"en": "Choose a path for Pterodactyl. For now, only /pterodactyl is accepted",
|
|
||||||
"fr": "Choisissez un chemin pour Pterodactyl. Pour l'instant seulement /pterodactyl est accepté"
|
|
||||||
},
|
|
||||||
"example": "/pterodactyl",
|
"example": "/pterodactyl",
|
||||||
"default": "/pterodactyl"
|
"default": "/pterodactyl"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "admin",
|
"name": "admin",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"ask": {
|
|
||||||
"en": "Choose an admin user (should be a YunoHost registered user)",
|
|
||||||
"fr": "Choisissez l’administrateur (should be a YunoHost registered user)"
|
|
||||||
},
|
|
||||||
"example": "johndoe"
|
"example": "johndoe"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -64,19 +52,11 @@
|
||||||
{
|
{
|
||||||
"name": "password",
|
"name": "password",
|
||||||
"type": "password",
|
"type": "password",
|
||||||
"ask": {
|
|
||||||
"en": "Set the administrator password",
|
|
||||||
"fr": "Définissez le mot de passe administrateur"
|
|
||||||
},
|
|
||||||
"example": "Choose a password"
|
"example": "Choose a password"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "is_public",
|
"name": "is_public",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"ask": {
|
|
||||||
"en": "Is it a public site?",
|
|
||||||
"fr": "Est-ce un site public ?"
|
|
||||||
},
|
|
||||||
"default": true
|
"default": true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@ extra_php_dependencies="php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-gd php${
|
||||||
|
|
||||||
pkg_dependencies="libargon2-1 libsodium23 apt-transport-https unzip tar make gcc g++"
|
pkg_dependencies="libargon2-1 libsodium23 apt-transport-https unzip tar make gcc g++"
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# EXPERIMENTAL HELPERS
|
# EXPERIMENTAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -20,46 +19,3 @@ pkg_dependencies="libargon2-1 libsodium23 apt-transport-https unzip tar make gcc
|
||||||
#=======================
|
#=======================
|
||||||
# COMPOSER
|
# COMPOSER
|
||||||
#=======================
|
#=======================
|
||||||
|
|
||||||
# Execute a command with Composer
|
|
||||||
#
|
|
||||||
# usage: ynh_composer_exec [--workdir=$final_path] --commands="commands"
|
|
||||||
# | arg: -w, --workdir - The directory from where the command will be executed. Default $final_path.
|
|
||||||
# | arg: -c, --commands - Commands to execute.
|
|
||||||
ynh_composer_exec () {
|
|
||||||
# Declare an array to define the options of this helper.
|
|
||||||
local legacy_args=wc
|
|
||||||
declare -Ar args_array=( [w]=workdir= [c]=commands= )
|
|
||||||
local workdir
|
|
||||||
local commands
|
|
||||||
# Manage arguments with getopts
|
|
||||||
ynh_handle_getopts_args "$@"
|
|
||||||
workdir="${workdir:-$final_path}"
|
|
||||||
|
|
||||||
COMPOSER_HOME="$workdir/.composer" \
|
|
||||||
php "$workdir/composer.phar" $commands \
|
|
||||||
-d "$workdir" --quiet --no-interaction
|
|
||||||
}
|
|
||||||
|
|
||||||
# Install and initialize Composer in the given directory
|
|
||||||
#
|
|
||||||
# usage: ynh_install_composer [--workdir=$final_path]
|
|
||||||
# | arg: -w, --workdir - The directory from where the command will be executed. Default $final_path.
|
|
||||||
ynh_install_composer () {
|
|
||||||
# Declare an array to define the options of this helper.
|
|
||||||
local legacy_args=w
|
|
||||||
declare -Ar args_array=( [w]=workdir= )
|
|
||||||
local workdir
|
|
||||||
# Manage arguments with getopts
|
|
||||||
ynh_handle_getopts_args "$@"
|
|
||||||
workdir="${workdir:-$final_path}"
|
|
||||||
|
|
||||||
curl -sS https://getcomposer.org/installer \
|
|
||||||
| COMPOSER_HOME="$workdir/.composer" \
|
|
||||||
php -- --quiet --install-dir="$workdir" \
|
|
||||||
|| ynh_die "Unable to install Composer."
|
|
||||||
|
|
||||||
# update dependencies to create composer.lock
|
|
||||||
ynh_composer_exec --workdir="$workdir" --commands="install --no-dev" \
|
|
||||||
|| ynh_die "Unable to update core dependencies with Composer."
|
|
||||||
}
|
|
Loading…
Reference in a new issue