diff --git a/src/.s2i/bin/assemble b/src/.s2i/bin/assemble index c7d138b4..ad365069 100755 --- a/src/.s2i/bin/assemble +++ b/src/.s2i/bin/assemble @@ -1,28 +1,30 @@ #!/bin/bash set -e shopt -s dotglob echo "--->> $(rm -vrf vendor/ composer.lock)" if [ -f ".env.local" ]; then # Ensure there's a line ending echo "---->> Append .env.local" echo "" >> .env cat .env.local >> .env fi env /usr/libexec/s2i/assemble cat >> /opt/app-root/etc/conf.d/99-loglevel.conf << EOF LogLevel debug mod_rewrite.c:trace2 EOF +pecl install swoole + pushd /opt/app-root/src echo "---->> Run npm run prod" npm install cross-env npm run prod diff --git a/src/.s2i/bin/run b/src/.s2i/bin/run index d7fd2264..14c5026e 100755 --- a/src/.s2i/bin/run +++ b/src/.s2i/bin/run @@ -1,60 +1,60 @@ #!/bin/bash shopt -s dotglob 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 fi if [ -z ${JWT_SECRET} ]; then echo "----> Run artisan jwt:secret" ./artisan jwt:secret --always-no fi echo "----> Run artisan clear-compiled" ./artisan clear-compiled echo "----> Run artisan cache:clear" ./artisan ${ARTISAN_VERBOSITY} cache:clear || true # rpm -qv chromium # if [ ! -z "$(rpm -qv chromium 2>/dev/null)" ]; then # echo "---- Run artisan dusk:chrome-driver" # chver=$(rpmquery --queryformat="%{VERSION}" chromium | awk -F'.' '{print $1}') # ./artisan dusk:chrome-driver ${chver} # fi if [ ! -f 'resources/countries.php' ]; then echo "----> Run artisan data:countries" ./artisan data:countries fi rm -rvf bootstrap/cache/ mkdir -vp bootstrap/cache/ chown default bootstrap/cache ./artisan db:ping --wait || exit 1 ./artisan migrate --force || : ./artisan db:seed --force || : case ${HKCCP_APP} in worker|WORKER ) echo "----> Running worker " ./artisan queue:work;; server|SERVER ) echo "----> Running server " ./artisan serve;; apache|APACHE|httpd|HTTPD ) echo "----> Starting httpd " - /usr/libexec/s2i/run;; + /usr/libexec/s2i/run 2>&1;; * ) echo "----> Sleeping" sleep 10000;; esac