[enh] Change setup into upgrade and add ip command

This commit is contained in:
zamentur 2015-10-12 02:40:42 +02:00
parent a9de666a89
commit 8b018354d5

31
ynh-dev
View file

@ -3,13 +3,22 @@
usage() { usage() {
print " print "
Usage : Usage :
On the host
`basename $0` create-env PATH On the host
`basename $0` run DOMAIN [VM VERSION] `basename $0` create-env PATH
Inside the vm Create a dev environement into PATH
`basename $0` setup `basename $0` run DOMAIN [VM VERSION]
`basename $0` deploy [PAQUET [PAQUET ...]] Run a docker or virtualbox vm
`basename $0` watch [PAQUET [PAQUET ...]]
Inside the vm
`basename $0` ip
Give the ip of the guest container
`basename $0` upgrade
Upgrade the container
`basename $0` deploy [PAQUET [PAQUET ...]]
Deploy sources to test it
`basename $0` watch [PAQUET [PAQUET ...]]
Deploy sources each time there is change
PAQUET : PAQUET :
moulinette moulinette
@ -80,13 +89,16 @@ elif [ "$1" = "run" ]; then
exit 100; exit 100;
fi fi
elif [ "$1" = "setup" ]; then elif [ "$1" = "upgrade" ]; then
check_yunohost_vm check_yunohost_vm
sudo apt-get update sudo apt-get update
sudo apt-get -y upgrade sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade sudo apt-get -y dist-upgrade
sudo apt-get install -y inotify-tools net-tools sudo apt-get install -y inotify-tools net-tools
elif [ "$1" = "ip" ]; then
check_yunohost_vm
sudo apt-get install -y net-tools
/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'
elif [ "$1" = "deploy" ]; then elif [ "$1" = "deploy" ]; then
check_yunohost_vm check_yunohost_vm
for i in ${!paquets[@]}; do for i in ${!paquets[@]}; do
@ -121,6 +133,7 @@ elif [ "$1" = "deploy" ]; then
done done
elif [ "$1" = "watch" ]; then elif [ "$1" = "watch" ]; then
check_yunohost_vm check_yunohost_vm
sudo apt-get install -y inotify-tools
while inotifywait -r -e close_write $BASE_DIR/moulinette/ $BASE_DIR/SSOwat/ $BASE_DIR/yunohost/ $BASE_DIR/yunohost-admin/; do while inotifywait -r -e close_write $BASE_DIR/moulinette/ $BASE_DIR/SSOwat/ $BASE_DIR/yunohost/ $BASE_DIR/yunohost-admin/; do
$BASE_DIR/$0 deploy ${@:2}; $BASE_DIR/$0 deploy ${@:2};
done done