ynh-dev/README.md

88 lines
1.9 KiB
Markdown
Raw Normal View History

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-04-27 09:23:32 +02:00
sudo apt-get install vagrant
2016-01-30 22:38:29 +01:00
# Fedora
sudo dnf install vagrant
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
2016-05-03 14:32:53 +02:00
ynh-dev create-env /path/to/dev/env
2016-01-30 22:38:29 +01:00
### Run a container
2016-05-03 14:32:53 +02:00
cd /path/to/dev/env
ynh-dev run ynh.local 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
(sudo) yunohost tools postinstall
2016-05-03 14:30:52 +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-04-27 12:26:11 +02:00
It will update every debian packages.
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
***Note***: These changes can be reverted now.
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-04-27 12:26:11 +02:00
2016-01-30 22:38:29 +01:00
### Deploy your change
2016-05-03 14:32:53 +02:00
/vagrant/ynh-dev deploy
2016-01-30 22:38:29 +01:00
### Deploy your change in realtime (each time you saved source code)
2016-05-03 14:32:53 +02:00
/vagrant/ynh-dev watch
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
/vagrant/ynh-dev ip
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)