Skip to content
Extraits de code Groupes Projets
Valider 35d57703 rédigé par nicod's avatar nicod
Parcourir les fichiers

Ajout de checkout aux commandes disponibles avec ddev

parent 6eb60620
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
(english below)
# [fr] Intégration de spip-cli à DDEV
# [fr] Intégration de spip-cli et checkout à DDEV
DDEV est une couche d'abstraction à docker et docker-compose qui permet de mettre en place rapidement des environnements de développement avec de multiples versions de PHP, de Mysql, avec Apache ou Nginx, sans avoir rien installer ou modifier sur la machine hôte.
https://ddev.readthedocs.io
Ce script permet d'intégrer [spip-cli](https://contrib.spip.net/SPIP-Cli) parmi les outils disponibles (comme composer, drush, artisan, wp-cli), pour l'installer dans le conteneur et interagir avec le SPIP qui y est installé.
Ce script permet d'intégrer [spip-cli](https://contrib.spip.net/SPIP-Cli) et [checkout](https://git.spip.net/spip-contrib-outils/checkout) parmi les outils disponibles (comme composer, drush, artisan, wp-cli), pour l'installer dans le conteneur et interagir avec le SPIP qui y est installé.
spip-cli fonctionnera alors avec la version de PHP du conteneur, et pas avec celle de la machine hôte.
Ils fonctionneront alors avec la version de PHP du conteneur, et pas avec celle de la machine hôte.
## 1/ Installation :
- pour une utilisation globale pour tous les projets, copier ce script bash dans `~/.ddev/commands/web`
- ou bien, pour une utilisation par projet, le copier simplement dans `/var/www/html/nom_du_site/.ddev/commands/web`
## 1/ Installation
- pour une utilisation globale pour tous les projets, copier les fichiers `spip` et `checkout` script bash dans `~/.ddev/commands/web`
- ou bien, pour une utilisation par projet, les copier simplement dans `/var/www/html/nom_du_site/.ddev/commands/web`
puis redémarrer le projet pour pouvoir l'utiliser : `ddev restart nom_du_site`.
puis redémarrer le projet pour pouvoir les utiliser : `ddev restart nom_du_site`.
Si tout est ok, vous devez voir `spip` dans la liste des commandes disponibles avec `ddev -h`.
Si tout est ok, vous devez les voir dans la liste des commandes disponibles avec `ddev -h`.
## 2/ Utilisation
Il suffit de lancer une première fois `ddev spip`, qui vous proposera d'installer spip-cli, puis de l'utiliser avec les commandes habituelles, par exemple : `ddev spip dl`.
Il suffit de lancer une première fois `ddev spip` ou `ddev checkout`, qui vous proposera de les installer, puis de les utiliser avec les commandes habituelles, par exemple : `ddev spip dl` ou `ddev checkout spip .`
En cas de restart du conteneur, les fichiers de son système sont écrasés, il faut donc relancer l'installation.
# [en] Integration of spip-cli with DDEV
# [en] Integration of spip-cli and checkout with DDEV
DDEV is an abstraction layer to docker and docker-compose that allows to quickly set up development environments with multiple versions of PHP, Mysql, with Apache or Nginx, without having to install or modify anything on the host machine.
https://ddev.readthedocs.io
This script allows you to integrate [spip-cli](https://contrib.spip.net/SPIP-Cli) with the available tools (such as composer, drush, artisan, wp-cli), to install it in the container and interact with the SPIP installed there.
This script allows you to integrate [spip-cli](https://contrib.spip.net/SPIP-Cli) and [checkout](https://git.spip.net/spip-contrib-outils/checkout) with the available tools (such as composer, drush, artisan, wp-cli), to install it in the container and interact with the SPIP installed there.
spip-cli will then work with the version of PHP in the container, and not with the version on the host machine.
spip-cli and checkout will then work with the version of PHP in the container, and not with the version on the host machine.
## 1/ Installation :
## 1/ Installation
- for global use for all projects, copy this bash script into `~/.ddev/commands/web`
- or, for a use per project, simply copy it in `/var/www/html/site_name/.ddev/commands/web`
- for global use for all projects, copy the files `spip` and `checkout` into `~/.ddev/commands/web`
- or, for a use per project, simply copy these in `/var/www/html/site_name/.ddev/commands/web`
then restart the project to be able to use it : `ddev restart site_name`.
If everything is ok, you should see `spip` in the list of available commands with `ddev -h`.
If everything is ok, you should see them in the list of available commands with `ddev -h`.
## 2/ Use
You just have to run `ddev spip` once, which will propose you to install spip-cli, then use it with the usual commands, for example : ddev spip dl.
You just have to run `ddev spip` or `ddev checkout` once, which will propose you to install it, then use it with the usual commands, for example : `ddev spip dl` or `ddev checkout spip .`
If the container is restarted, its system files will be overwritten, so you will have to restart the installation.
#!/bin/bash
#ddev-generated
## Description: Command line interface for SPIP https://git.spip.net/spip-contrib-outils/checkout
## Usage: checkout [install|commands]
## OSTypes: linux
## ExecRaw: true
function install_checkout {
# installation
cd /opt
sudo git clone https://git.spip.net/spip-contrib-outils/checkout.git
cd checkout
sudo ln -s $(pwd)/checkout /usr/local/bin/checkout
}
if [ "$1" == "install-checkout" ]; then
install_checkout
exit
else
if ! command -v checkout >/dev/null; then
read -p "Installer checkout ? [O/n]" ouinon
ouinon="${ouinon:-o}"
case $ouinon in
[oO]* )
install_checkout
exit;;
* )
echo Installation annulée...
exit;;
esac
else
checkout "$@"
fi
exit
fi
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter