Fix running composer with respect to different WEBROOT.
The composer configuration should always be located in the project root, independently where the webroot is located. Closes #95.
This commit is contained in:
@@ -44,6 +44,8 @@ One example would be, if you are running craft CMS you'll end up with a repo str
|
|||||||
|
|
||||||
In this case __WEBROOT__ would be set as __/var/www/html/public__
|
In this case __WEBROOT__ would be set as __/var/www/html/public__
|
||||||
|
|
||||||
|
Note that if you are managing dependencies with composer, your composer.json and composer.lock files should *always* be located in the repo root, not in the directory you set as __WEBROOT__.
|
||||||
|
|
||||||
### conf
|
### conf
|
||||||
This directory is where you can put config files you call from your scripts. It is also home to the nginx folder where you can include custom nginx config files.
|
This directory is where you can put config files you call from your scripts. It is also home to the nginx folder where you can include custom nginx config files.
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ if [ -z "$GIT_NAME" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Try auto install for composer
|
# Try auto install for composer
|
||||||
if [ -f "$WEBROOT/composer.lock" ]; then
|
if [ -f "/var/www/html/composer.lock" ]; then
|
||||||
php composer.phar install --no-dev
|
composer install --no-dev --working-dir=/var/www/html
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd /var/www/html
|
cd /var/www/html
|
||||||
|
|||||||
@@ -17,10 +17,7 @@ fi
|
|||||||
|
|
||||||
# Set custom webroot
|
# Set custom webroot
|
||||||
if [ ! -z "$WEBROOT" ]; then
|
if [ ! -z "$WEBROOT" ]; then
|
||||||
webroot=$WEBROOT
|
sed -i "s#root /var/www/html;#root ${WEBROOT};#g" /etc/nginx/sites-available/default.conf
|
||||||
sed -i "s#root /var/www/html;#root ${webroot};#g" /etc/nginx/sites-available/default.conf
|
|
||||||
else
|
|
||||||
webroot=/var/www/html
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Setup git variables
|
# Setup git variables
|
||||||
@@ -62,8 +59,8 @@ if [ ! -d "/var/www/html/.git" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Try auto install for composer
|
# Try auto install for composer
|
||||||
if [ -f "$WEBROOT/composer.lock" ]; then
|
if [ -f "/var/www/html/composer.lock" ]; then
|
||||||
php composer.phar install --no-dev
|
composer install --no-dev --working-dir=/var/www/html
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Enable custom nginx config files if they exist
|
# Enable custom nginx config files if they exist
|
||||||
|
|||||||
Reference in New Issue
Block a user