[enh] Remove submodules system to prefer a bash script

This commit is contained in:
zamentur 2015-10-12 01:06:12 +02:00
parent d623e8dd42
commit 1664d1298c
8 changed files with 53 additions and 35 deletions

22
.gitmodules vendored
View file

@ -1,22 +0,0 @@
[submodule "SSOwat"]
path = SSOwat
url = https://github.com/Kloadut/SSOwat
branch = unstable
[submodule "yunohost-admin"]
path = yunohost-admin
url = https://github.com/YunoHost/yunohost-admin.git
branch = unstable
[submodule "yunohost"]
path = yunohost
url = https://github.com/YunoHost/yunohost
branch = unstable
[submodule "moulinette"]
path = moulinette
url = https://github.com/YunoHost/moulinette
branch = unstable
[submodule "Dockerfile"]
path = Dockerfile
url = https://github.com/YunoHost/Dockerfile
[submodule "yunohost-vagrant"]
path = yunohost-vagrant
url = https://github.com/zamentur/yunohost-vagrant

@ -1 +0,0 @@
Subproject commit e598efab1daa882867c97de805840b0f331dc971

1
SSOwat

@ -1 +0,0 @@
Subproject commit 1e9087b644b44f48a5601e2acadbd16e3bfa338b

@ -1 +0,0 @@
Subproject commit 3d589b59d7138689ba3c7dbe0b2c4115be7444d5

60
ynh-dev
View file

@ -3,6 +3,10 @@
usage() { usage() {
print " print "
Usage : Usage :
On the host
`basename $0` create-env PATH
`basename $0` run DOMAIN [VM VERSION]
Inside the vm
`basename $0` setup `basename $0` setup
`basename $0` deploy [PAQUET [PAQUET ...]] `basename $0` deploy [PAQUET [PAQUET ...]]
`basename $0` watch [PAQUET [PAQUET ...]] `basename $0` watch [PAQUET [PAQUET ...]]
@ -12,9 +16,29 @@ PAQUET :
ssowat ssowat
yunohost yunohost
yunohost-admin yunohost-admin
VM
docker
virtualbox
VERSION
stable8
testing8
unstable8
stable7
testing7
unstable7
" "
} }
check_yunohost_vm() {
if [ ! -d /etc/yunohost ]
then
echo "You need to install YunoHost first. Maybe you are not in a vm ?"
exit 100;
fi
}
paquets=${@:2} paquets=${@:2}
if [ "$#" = "1" ]; then if [ "$#" = "1" ]; then
paquets=moulinette ssowat yunohost yunohost-admin paquets=moulinette ssowat yunohost yunohost-admin
@ -22,17 +46,39 @@ fi
BASE_DIR=/yunohost BASE_DIR=/yunohost
if [ ! -d /etc/yunohost ]
then
echo "You need to install YunoHost first. Maybe you are not in a vm ?"
exit 100;
fi
if [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "help" ]; then if [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "help" ]; then
usage usage
elif [ "$1" = "create-env" ]; then
pwd=`pwd`
cd $2
mkdir -p apps
mkdir -p backup
git clone -b unstable https://github.com/Kloadut/SSOwat SSOwat
git clone -b unstable https://github.com/YunoHost/yunohost-admin yunohost-admin
git clone -b unstable https://github.com/YunoHost/yunohost yunohost
git clone -b unstable https://github.com/YunoHost/moulinette moulinette
git clone https://github.com/YunoHost/Dockerfile Dockerfile
git clone https://github.com/zamentur/yunohost-vagrant yunohost-vagrant
cp $pwd/$0 ./$0
elif [ "$1" = "run" ]; then
DOMAIN=$2
VM=$3
VERSION=$4
if [ "$VM" = "docker" ]; then
docker exec -t -i $(sudo docker run -h yunohost.$DOMAIN -v $(pwd):/yunohost -d zamentur/yunohost-$VERSION /sbin/init) /bin/bash
elif [ "$VM" = "virtualbox" ]; then
vagrant up $VERSION
vagrant ssh $VERSION
else
echo "This kind of VM is not supported"
exit 100;
fi
elif [ "$1" = "setup" ]; then elif [ "$1" = "setup" ]; then
check_yunohost_vm
sudo apt-get install -y inotify-tools sudo apt-get install -y inotify-tools
elif [ "$1" = "deploy" ]; then elif [ "$1" = "deploy" ]; then
check_yunohost_vm
for paquet in $paquets; do for paquet in $paquets; do
case $paquet in case $paquet in
moulinette) moulinette)
@ -58,7 +104,7 @@ elif [ "$1" = "deploy" ]; then
esac esac
done done
elif [ "$1" = "watch" ]; then elif [ "$1" = "watch" ]; then
check_yunohost_vm
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

@ -1 +0,0 @@
Subproject commit 1beadf3051ae190fd859ad234000dc24c97b565b

@ -1 +0,0 @@
Subproject commit 0bb8fe6e4da0a1ef02e32aed350c1fa2cfed1301

@ -1 +0,0 @@
Subproject commit 7d4e8dfacbc4befeafe4c3aa686ecb74a9d7f8ac