Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added missing lagoon download source support to installer. #1532

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
$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?");

Check warning on line 267 in .vortex/installer/src/Command/InstallCommand.php

View check run for this annotation

Codecov / codecov/patch

.vortex/installer/src/Command/InstallCommand.php#L267

Added line #L267 was not covered by tests

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 @@
return match ($value) {
'f', 'ftp' => 'ftp',
'a', 'acquia' => 'acquia',
'l', 'lagoon' => 'lagoon',

Check warning on line 744 in .vortex/installer/src/Traits/PromptsTrait.php

View check run for this annotation

Codecov / codecov/patch

.vortex/installer/src/Traits/PromptsTrait.php#L744

Added line #L744 was not covered by tests
'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
Loading