Skip to content

Commit

Permalink
Make artisan cache creation optional (#96)
Browse files Browse the repository at this point in the history
This is helpful when deploying locally on a development machine for testing.

To disable caching, inject to the container an environment variable ARTISAN_CACHE=false

Co-authored-by: Travis Austin <[email protected]>
  • Loading branch information
travisaustin and Travis Austin authored Nov 26, 2024
1 parent b82e531 commit 7a1576b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions deployment/start-container
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ set -e
container_mode=${CONTAINER_MODE:-"http"}
octane_server=${OCTANE_SERVER}
running_migrations_and_seeders=${RUNNING_MIGRATIONS_AND_SEEDERS:-"false"}
artisan_cache=${ARTISAN_CACHE:-"true"}

echo "Container mode: $container_mode"

initialStuff() {
php artisan storage:link; \
php artisan optimize:clear; \
php artisan event:cache; \
php artisan config:cache; \
php artisan route:cache;

if [ "${artisan_cache}" = "true" ]; then
php artisan storage:link; \
php artisan optimize:clear; \
php artisan event:cache; \
php artisan config:cache; \
php artisan route:cache;
fi

if [ "${running_migrations_and_seeders}" = "true" ]; then
echo "Running migrations and seeding database ..."
Expand Down

0 comments on commit 7a1576b

Please sign in to comment.