Skip to content

Commit

Permalink
Added missing lagoon download source support to installer.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Jan 31, 2025
1 parent e9c3b84 commit 72daee2
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .vortex/installer/src/Command/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ protected function collectAnswers(): void {
$this->setAnswer('database_image', '');
}
else {
$this->askForAnswer('database_download_source', "Where does the database dump come from into every environment:\n - [u]rl\n - [f]tp\n - [a]cquia backup\n - [d]ocker registry?");
$this->askForAnswer('database_download_source', "Where does the database dump come from into every environment:\n - [u]rl\n - [f]tp\n - [a]cquia backup\n - [l]lagoon environment\n - [d]ocker registry?");

if ($this->getAnswer('database_download_source') !== 'container_registry') {
// Note that "database_store_type" is a pseudo-answer - it is only used
Expand Down
1 change: 1 addition & 0 deletions .vortex/installer/src/Traits/PromptsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,7 @@ protected function normaliseAnswerDatabaseDownloadSource(string $value): string
return match ($value) {
'f', 'ftp' => 'ftp',
'a', 'acquia' => 'acquia',
'l', 'lagoon' => 'lagoon',
'i', 'image', 'container_image', 'container_registry' => 'container_registry',
'c', 'curl' => 'curl',
default => $this->getDefaultValueDatabaseDownloadSource(),
Expand Down
2 changes: 1 addition & 1 deletion .vortex/tests/bats/deployment1.bats
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ load _helper.deployment.bash
"nothing" # URL
"nothing" # webroot
"nothing" # provision_use_profile
"nothing" # database_download_source
"lagoon" # database_download_source
"nothing" # database_store_type
"nothing" # override_existing_db
"nothing" # ci_provider
Expand Down
46 changes: 46 additions & 0 deletions .vortex/tests/bats/install.integrations.bats
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,52 @@ load _helper.bash
assert_files_present_no_integration_renovatebot
}

@test "Install: empty directory; Lagoon" {
answers=(
"Star wars" # name
"nothing" # machine_name
"nothing" # org
"nothing" # org_machine_name
"nothing" # module_prefix
"nothing" # profile
"nothing" # theme
"nothing" # URL
"nothing" # webroot
"nothing" # provision_use_profile
"lagoon" # database_download_source
"nothing" # database_store_type
"nothing" # override_existing_db
"nothing" # ci_provider
"artifact" # deploy_type
"nothing" # preserve_ftp
"nothing" # preserve_acquia
"y" # preserve_lagoon
"nothing" # preserve_renovatebot
"nothing" # preserve_onboarding
"nothing" # preserve_doc_comments
"nothing" # preserve_vortex_info
)
output=$(run_installer_interactive "${answers[@]}")
assert_output_contains "WELCOME TO VORTEX INTERACTIVE INSTALLER"
assert_git_repo

install_dependencies_stub

assert_files_present_common
assert_files_present_no_provision_use_profile
assert_files_present_deployment
assert_files_present_no_integration_acquia
assert_files_present_integration_lagoon
assert_files_present_no_integration_ftp
assert_files_present_integration_renovatebot

assert_file_contains ".lagoon.yml" "name: Download database"
assert_file_contains ".lagoon.yml" "export VORTEX_PROVISION_OVERRIDE_DB=0"
assert_file_not_contains ".lagoon.yml" "# Explicitly set DB overwrite flag to the value from .env file for deployments from the profile."

assert_file_contains .env "VORTEX_DB_DOWNLOAD_SOURCE=lagoon"
}

@test "Install: empty directory; provision_use_profile; Lagoon" {
answers=(
"Star wars" # name
Expand Down

1 comment on commit 72daee2

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.