Installation script

This commit is contained in:
Simon Vieille 2016-09-27 22:49:43 +02:00
parent dcb3119e6c
commit 28eb7b2fbb
3 changed files with 47 additions and 23 deletions

View file

@ -42,24 +42,33 @@ ynh_mysql_create_db "$dbname" "$dbuser" "$dbpass"
# Copy source files # Copy source files
src_path=/var/www/$app src_path=/var/www/$app
git clone https://gitnet.fr/deblan/gist $src_path sudo mkdir -p /var/www/
sudo git clone https://gitnet.fr/deblan/gist $src_path
git config --global user.email "www-data@$domain"
git config --global user.email "www-data@$domain"
cd $src_path cd $src_path
git config --global user.email "www-data@$domain" sudo curl -sS https://getcomposer.org/installer | php
git config --global user.email "www-data@$domain" sudo mv composer.phar composer
curl -sS https://getcomposer.org/installer | php sudo chmod +x composer
mv composer.phar composer
chmod +x composer
export PATH="$PATH:."
sudo apt-get update -y sudo apt-get update -y
sudo apt-get install npm -y sudo apt-get install npm -y
sudo npm install -g bower sudo npm install -g bower
mv propel-dist.yaml propel.yaml
sed -i "s@user: root@user: $dbuser@" sudo mv propel-dist.yaml propel.yaml
sed -i "s@password: root@password: $dbpass@" sudo sed -i "s@user: root@user: $dbuser@"
make sudo sed -i "s@password: root@password: $dbpass@"
export PATH="$PATH:."
sudo make
sudo chown -R root: $src_path sudo chown -R root: $src_path
sudo chown -R www-data: $src_path/data/git/ sudo chown -R www-data: $src_path/data/git/
cd -
# Modify Nginx configuration file and copy it to Nginx conf directory # Modify Nginx configuration file and copy it to Nginx conf directory
nginx_conf=../conf/nginx.conf nginx_conf=../conf/nginx.conf
sed -i "s@YNH_WWW_PATH@$path@g" $nginx_conf sed -i "s@YNH_WWW_PATH@$path@g" $nginx_conf

View file

@ -22,21 +22,29 @@ sudo yunohost app checkurl "${domain}${path}" -a "$app" \
# Restore sources & data # Restore sources & data
src_path=/var/www/$app src_path=/var/www/$app
git clone https://gitnet.fr/deblan/gist $src_path
sudo mkdir -p /var/www/
sudo git clone https://gitnet.fr/deblan/gist $src_path
git config --global user.email "www-data@$domain"
git config --global user.email "www-data@$domain"
cd $src_path cd $src_path
git config --global user.email "www-data@$domain" sudo curl -sS https://getcomposer.org/installer | php
git config --global user.email "www-data@$domain" sudo mv composer.phar composer
curl -sS https://getcomposer.org/installer | php sudo chmod +x composer
mv composer.phar composer
chmod +x composer
export PATH="$PATH:."
sudo apt-get update -y sudo apt-get update -y
sudo apt-get install npm -y sudo apt-get install npm -y
sudo npm install -g bower sudo npm install -g bower
mv propel-dist.yaml propel.yaml
sed -i "s@user: root@user: $dbuser@" sudo mv propel-dist.yaml propel.yaml
sed -i "s@password: root@password: $dbpass@" sudo sed -i "s@user: root@user: $dbuser@"
make sudo sed -i "s@password: root@password: $dbpass@"
export PATH="$PATH:."
sudo make
sudo chown -R root: $src_path sudo chown -R root: $src_path
sudo chown -R www-data: $src_path/data/git/ sudo chown -R www-data: $src_path/data/git/

View file

@ -21,10 +21,17 @@ path=${path%/}
# Copy source files # Copy source files
src_path=/var/www/$app src_path=/var/www/$app
make update
export PATH="$PATH:."
cd $src_path
sudo make update
sudo chown -R root: $src_path sudo chown -R root: $src_path
sudo chown -R www-data: $src_path/data/git/ sudo chown -R www-data: $src_path/data/git/
cd -
# Reload nginx service # Reload nginx service
sudo service nginx reload sudo service nginx reload