2017-02-03 20:04:55 -06:00
|
|
|
#!/bin/bash
|
|
|
|
# Checks if there's a composer.json, and if so, installs/runs composer.
|
2017-02-04 01:42:06 -06:00
|
|
|
# This script only runs once, when the app connects to sandstorm.
|
2017-02-03 20:04:55 -06:00
|
|
|
set -euo pipefail
|
|
|
|
|
2018-01-16 14:34:36 -06:00
|
|
|
echo "In build.sh"
|
2017-02-03 20:04:55 -06:00
|
|
|
|
|
|
|
cd /opt/app
|
2018-01-16 15:01:55 -06:00
|
|
|
cp .env.sandstorm .env
|
2017-02-03 20:04:55 -06:00
|
|
|
|
|
|
|
if [ -f /opt/app/composer.json ] ; then
|
|
|
|
if [ ! -f composer.phar ] ; then
|
|
|
|
curl -sS https://getcomposer.org/installer | php
|
|
|
|
fi
|
|
|
|
php composer.phar install --no-dev --no-suggest
|
|
|
|
fi
|
|
|
|
|
|
|
|
# link storage folder
|
|
|
|
rm -rf /opt/app/storage
|
|
|
|
ln -s /var/storage /opt/app
|