Skip to content

Commit 7a1576b

Browse files
travisaustinTravis Austin
and
Travis Austin
authored
Make artisan cache creation optional (#96)
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]>
1 parent b82e531 commit 7a1576b

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

deployment/start-container

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,19 @@ set -e
44
container_mode=${CONTAINER_MODE:-"http"}
55
octane_server=${OCTANE_SERVER}
66
running_migrations_and_seeders=${RUNNING_MIGRATIONS_AND_SEEDERS:-"false"}
7+
artisan_cache=${ARTISAN_CACHE:-"true"}
78

89
echo "Container mode: $container_mode"
910

1011
initialStuff() {
11-
php artisan storage:link; \
12-
php artisan optimize:clear; \
13-
php artisan event:cache; \
14-
php artisan config:cache; \
15-
php artisan route:cache;
12+
13+
if [ "${artisan_cache}" = "true" ]; then
14+
php artisan storage:link; \
15+
php artisan optimize:clear; \
16+
php artisan event:cache; \
17+
php artisan config:cache; \
18+
php artisan route:cache;
19+
fi
1620

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

0 commit comments

Comments
 (0)