diff --git a/src/.s2i/bin/assemble b/src/.s2i/bin/assemble index 9a63dcc..8c7d30f 100755 --- a/src/.s2i/bin/assemble +++ b/src/.s2i/bin/assemble @@ -1,41 +1,41 @@ #!/bin/bash set -x set -e function fix-permissions () { chgrp -R 0 $1 chmod -R og+rw $1 find $1 -type d -exec chmod g+x {} + } shopt -s dotglob echo "--->> $(rm -vrf vendor/ composer.lock)" echo "---> Installing application source..." rm -fR /tmp/src/.git mv /tmp/src/* ./ pushd /opt/app-root/src ls fix-permissions /opt/app-root/src if [ -f "composer.json" ]; then echo "--->> Detected composer.json, running install" php -dmemory_limit=${COMPOSER_MEMORY_LIMIT:--1} /usr/bin/composer install ${COMPOSER_ARGS} rm -rf ~/.cache/composer/ fi #./artisan horizon:install #echo "---->> Run npm run prod" #npm install #npm run ${LARAVEL_ENV:=prod} && rm -rf ~/.npm/ # id ls -lisah /opt/app-root/src/bootstrap/cache/packages.php ls -lisah /opt/app-root/src/vendor -fix-permissions /opt/app-root/src +#fix-permissions /opt/app-root/src diff --git a/src/.s2i/bin/run b/src/.s2i/bin/run index 9174e40..9261269 100755 --- a/src/.s2i/bin/run +++ b/src/.s2i/bin/run @@ -1,62 +1,65 @@ #!/bin/bash shopt -s dotglob +id +ls -lisah /opt/app-root/src + pushd /opt/app-root/src echo "----> Remove bootstrap cache" find bootstrap/cache/ -type f ! -name ".gitignore" -delete if [ -z ${APP_KEY} ]; then echo "----> Run artisan key:generate" ./artisan key:generate unset APP_KEY fi echo "----> Run artisan clear-compiled" ./artisan clear-compiled if [ "${LARAVEL_ENV}" != "production" -a "${LARAVEL_ENV}" != "prod" ]; then echo "----> Run artisan cache:clear" ./artisan ${ARTISAN_VERBOSITY} cache:clear || true fi rm -rvf bootstrap/cache/ mkdir -vp bootstrap/cache/ chown default bootstrap/cache ./artisan db:ping --wait || exit 1 case ${ISV_ROLE} in apache|APACHE|httpd|HTTPD) echo "----> Starting httpd" /usr/libexec/s2i/run 2>&1 ;; horizon|HORIZON) ./artisan migrate --force || : echo "----> Starting horizon" ./artisan horizon ;; octane|OCTANE) echo "----> Running octane" exec ./artisan octane:start --host=0.0.0.0 ;; server|SERVER) echo "----> Running server" exec ./artisan serve ;; worker|WORKER ) ./artisan migrate --force || : echo "----> Running worker" exec ./artisan queue:work ;; * ) echo "----> Sleeping" exec sleep 10000 ;; esac