2016-01-30 22:38:29 +01:00
|
|
|
|
# ynh-dev, a yunohost dev env
|
2016-04-27 09:23:32 +02:00
|
|
|
|
|
|
|
|
|
This script is a cli to manage a yunohost development environement.
|
|
|
|
|
With this you can develop on the unstable version of yunohost quickly.
|
2016-01-30 22:38:29 +01:00
|
|
|
|
|
|
|
|
|
## Setup
|
2016-04-27 09:23:32 +02:00
|
|
|
|
|
2016-01-30 22:38:29 +01:00
|
|
|
|
Install dependencies
|
|
|
|
|
```shell
|
|
|
|
|
# Debian, Ubuntu, Mint
|
2016-05-27 13:13:05 +02:00
|
|
|
|
sudo apt-get install vagrant virtualbox
|
2016-01-30 22:38:29 +01:00
|
|
|
|
# Fedora
|
2016-05-27 13:13:05 +02:00
|
|
|
|
sudo dnf install vagrant virtualbox
|
2016-01-30 22:38:29 +01:00
|
|
|
|
```
|
|
|
|
|
|
2016-03-15 11:09:08 +01:00
|
|
|
|
Next download ynh-dev script
|
2016-01-30 22:38:29 +01:00
|
|
|
|
|
|
|
|
|
```shell
|
2016-04-27 09:40:28 +02:00
|
|
|
|
wget https://github.com/YunoHost/ynh-dev/raw/opi-boxes/ynh-dev
|
2016-01-30 22:38:29 +01:00
|
|
|
|
chmod u+x ynh-dev
|
|
|
|
|
```
|
2016-04-27 09:23:32 +02:00
|
|
|
|
|
|
|
|
|
## Host usage
|
|
|
|
|
|
|
|
|
|
The `ynh-dev` tool provides 2 usefull command to run into your host machine. One
|
|
|
|
|
create a development environment by cloning Git repositories, the other one is a
|
|
|
|
|
helper to run a Vagrant virtual machine in the right place.
|
|
|
|
|
|
2016-01-30 22:38:29 +01:00
|
|
|
|
### Create the environment
|
|
|
|
|
|
|
|
|
|
```shell
|
2016-05-06 19:38:05 +02:00
|
|
|
|
./ynh-dev create-env /path/to/dev/env
|
2016-01-30 22:38:29 +01:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Run a container
|
2016-05-26 06:36:50 +02:00
|
|
|
|
```shell
|
2016-04-27 09:23:32 +02:00
|
|
|
|
cd /path/to/dev/env
|
2016-05-06 19:38:05 +02:00
|
|
|
|
./ynh-dev run ynh.local virtualbox testing
|
2016-01-30 22:38:29 +01:00
|
|
|
|
```
|
|
|
|
|
|
2016-05-03 14:30:52 +02:00
|
|
|
|
You'll be automatically logged in the VM through ssh.
|
|
|
|
|
|
|
|
|
|
You probably wan't to run the postinstall now:
|
2016-05-03 14:32:53 +02:00
|
|
|
|
|
2016-05-04 14:02:01 +02:00
|
|
|
|
(sudo) yunohost tools postinstall -d ynh.local
|
2016-05-03 14:32:53 +02:00
|
|
|
|
|
2016-04-27 09:23:32 +02:00
|
|
|
|
## Inside the Virtual machine (VM)
|
|
|
|
|
|
|
|
|
|
Once logged into your VM, go to `/vagrant` to enjoy folder sharing, and take
|
|
|
|
|
advantages of the `ynh-dev` script.
|
|
|
|
|
|
2016-01-30 22:38:29 +01:00
|
|
|
|
### Upgrade the container
|
|
|
|
|
|
2016-05-03 14:36:13 +02:00
|
|
|
|
It will update every debian packages, including YunoHost ones.
|
2016-05-03 14:32:53 +02:00
|
|
|
|
|
|
|
|
|
/vagrant/ynh-dev upgrade
|
2016-01-30 22:38:29 +01:00
|
|
|
|
|
2016-04-27 12:26:11 +02:00
|
|
|
|
### Use Git repositories
|
|
|
|
|
|
|
|
|
|
When doing `create-env` command, every YunoHost package have been cloned in the
|
|
|
|
|
corresponding path. Use these Git repositories inside the VM (with symlink).
|
|
|
|
|
Your changes will be available immediatly in your VM.
|
2016-05-03 14:32:53 +02:00
|
|
|
|
|
|
|
|
|
/vagrant/ynh-dev use-git
|
2016-04-27 12:26:11 +02:00
|
|
|
|
|
2016-05-26 09:25:06 +02:00
|
|
|
|
***Note***: These changes can't be reverted now.
|
2016-04-27 12:26:11 +02:00
|
|
|
|
|
|
|
|
|
Alternatively you can use Git only for one packages (ssowat, yunohost,
|
|
|
|
|
moulinette, yunohost-admin)
|
2016-05-03 14:32:53 +02:00
|
|
|
|
|
|
|
|
|
/vagrant/ynh-dev use-git PACKAGE_NAME
|
2016-01-30 22:38:29 +01:00
|
|
|
|
|
2016-04-27 09:23:32 +02:00
|
|
|
|
|
2016-01-30 22:38:29 +01:00
|
|
|
|
### Get ip address of your vm
|
2016-05-03 14:32:53 +02:00
|
|
|
|
|
2016-05-03 14:36:13 +02:00
|
|
|
|
/vagrant/ynh-dev ip
|
2016-01-30 22:38:29 +01:00
|
|
|
|
|
2016-05-03 14:32:53 +02:00
|
|
|
|
|
2016-05-03 14:36:13 +02:00
|
|
|
|
### Update `ynh-dev` script
|
2016-04-27 09:23:32 +02:00
|
|
|
|
|
2016-05-03 14:36:13 +02:00
|
|
|
|
/vagrant/ynh-dev self-update
|
2016-05-03 14:32:53 +02:00
|
|
|
|
|
2016-01-30 22:38:29 +01:00
|
|
|
|
|
|
|
|
|
## More info
|
|
|
|
|
|
2016-05-03 14:32:53 +02:00
|
|
|
|
[yunohost.org/dev_fr](https://yunohost.org/dev_fr) (in french)
|