Skip to content

Commit 431c507

Browse files
authored
Fixed unable to load Drupal settings error during provision. (#184)
1 parent 5e40e22 commit 431c507

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

.devtools/provision.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ fi
5454
db_file="/tmp/site_${extension}.sqlite"
5555

5656
info "Installing Drupal into SQLite database ${db_file}."
57-
drush sql:drop -y || true >/dev/null
57+
db_status=$(drush status --field=db-status)
58+
if [ "${db_status}" = "Connected" ]; then
59+
drush sql:drop -y || true >/dev/null
60+
fi
5861
drush site-install "${DRUPAL_PROFILE}" -y --db-url="sqlite://localhost/${db_file}" --account-name=admin install_configure_form.enable_update_status_module=NULL install_configure_form.enable_update_status_emails=NULL
5962

6063
pass "Drupal installed."

.scaffold/tests/bats/ahoy.bats

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,19 @@ export BATS_FIXTURE_EXPORT_CODEBASE_ENABLED=1
6262
assert_output_contains "ENVIRONMENT STOPPED"
6363
}
6464

65+
@test "ahoy provision" {
66+
run ahoy assemble
67+
run ahoy start
68+
run ahoy provision
69+
assert_success
70+
assert_output_contains "PROVISION COMPLETE"
71+
assert_output_not_contains "Do you really want to drop all tables in the database"
72+
run ahoy provision
73+
assert_success
74+
assert_output_contains "PROVISION COMPLETE"
75+
assert_output_contains "Do you really want to drop all tables in the database"
76+
}
77+
6578
@test "ahoy build - basic workflow" {
6679
run ahoy build
6780
assert_success

.scaffold/tests/bats/make.bats

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,19 @@ export BATS_FIXTURE_EXPORT_CODEBASE_ENABLED=1
6868
assert_output_contains "ENVIRONMENT STOPPED"
6969
}
7070

71+
@test "make provision" {
72+
run make assemble
73+
run make start
74+
run make provision
75+
assert_success
76+
assert_output_contains "PROVISION COMPLETE"
77+
assert_output_not_contains "Do you really want to drop all tables in the database"
78+
run make provision
79+
assert_success
80+
assert_output_contains "PROVISION COMPLETE"
81+
assert_output_contains "Do you really want to drop all tables in the database"
82+
}
83+
7184
@test "make build - basic workflow" {
7285
run make build
7386
assert_success

0 commit comments

Comments
 (0)