refactor: move herokuish app cache from the filesystem into a docker volume

This simplifies cache referencing and also paves the way for removing more from the app git directory.

Refs #1558
This commit is contained in:
Jose Diaz-Gonzalez committed 2023-08-05 10:35:54 -04:00
1 parent ce0177967d
commit 40b20e0c08
13 files changed
+126 -50

No files matched your search

+19 -10
View File
@@ -4,9 +4,11 @@ load test_helper
setup() {
global_setup
create_app
}
teardown() {
destroy_app
global_teardown
}
@@ -24,7 +26,7 @@ teardown() {
assert_output "$help_output"
}
@test "(repo) repo:gc, repo:purge-cache" {
@test "(repo) repo:gc" {
run deploy_app
echo "output: $output"
echo "status: $status"
@@ -34,29 +36,36 @@ teardown() {
echo "output: $output"
echo "status: $status"
assert_success
}
run /bin/bash -c "touch $DOKKU_ROOT/$TEST_APP/cache/derp"
@test "(repo) repo:purge-cache" {
run deploy_app
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "find $DOKKU_ROOT/$TEST_APP/cache -type f | wc -l"
run /bin/bash -c "docker volume ls -q --filter label=com.dokku.app-name=$TEST_APP | wc -l"
echo "count: '$output'"
echo "status: $status"
assert_not_output 0
run /bin/bash -c "dokku repo:purge-cache $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_success
assert_output 1
run /bin/bash -c "find $DOKKU_ROOT/$TEST_APP/cache -type f | wc -l"
echo "count: '$output'"
echo "status: $status"
assert_output 0
run destroy_app
run /bin/bash -c "dokku repo:purge-cache $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "docker volume ls -q --filter label=com.dokku.app-name=$TEST_APP | wc -l"
echo "count: '$output'"
echo "status: $status"
assert_output 0
run /bin/bash -c "find $DOKKU_ROOT/$TEST_APP/cache -type f | wc -l"
echo "count: '$output'"
echo "status: $status"
assert_output 0
}