diff --git a/.env.local.default b/.env.local.default index 717892d3e..05df133a4 100644 --- a/.env.local.default +++ b/.env.local.default @@ -55,15 +55,6 @@ DREVOPS_ACQUIA_SECRET= #;> ACQUIA #;> !PROVISION_USE_PROFILE -#;< !PROVISION_USE_PROFILE -#;< LAGOON -# Database dump file sourced from Lagoon. - -# SSH key file used to access Lagoon environment to download the database. -# Create an SSH key and add it to your account in the Lagoon Dashboard. -DREVOPS_DB_DOWNLOAD_SSH_FILE=$HOME/.ssh/id_rsa -#;> LAGOON -#;> !PROVISION_USE_PROFILE #;< !PROVISION_USE_PROFILE #;< DREVOPS_DB_DOWNLOAD_SOURCE_DOCKER_REGISTRY # Docker registry credentials to read and write Docker images. diff --git a/.scaffold/docs/content/workflows/variables.mdx b/.scaffold/docs/content/workflows/variables.mdx index 0b47355a0..82c7950c9 100644 --- a/.scaffold/docs/content/workflows/variables.mdx +++ b/.scaffold/docs/content/workflows/variables.mdx @@ -362,11 +362,11 @@ Defined in: `.env`, `scripts/drevops/download-db.sh` ### `DREVOPS_DB_DOWNLOAD_SSH_FILE` -SSH key file used to access Lagoon environment to download the database.
Create an SSH key and add it to your account in the Lagoon Dashboard. +Default SSH file used if custom fingerprint is not provided. Default value: `HOME/.ssh/id_rsa` -Defined in: `.env.local.default`, `scripts/drevops/download-db-lagoon.sh` +Defined in: `scripts/drevops/download-db-lagoon.sh` ### `DREVOPS_DB_DOWNLOAD_SSH_FINGERPRINT` diff --git a/.scaffold/tests/bats/_helper.bash b/.scaffold/tests/bats/_helper.bash index 1ef82fbf1..518023c92 100644 --- a/.scaffold/tests/bats/_helper.bash +++ b/.scaffold/tests/bats/_helper.bash @@ -589,7 +589,6 @@ assert_files_present_provision_use_profile() { assert_file_not_contains ".env.local.default" "DREVOPS_DB_DOWNLOAD_FTP_PASS" assert_file_not_contains ".env.local.default" "DREVOPS_ACQUIA_KEY" assert_file_not_contains ".env.local.default" "DREVOPS_ACQUIA_SECRET" - assert_file_not_contains ".env.local.default" "DREVOPS_DB_DOWNLOAD_SSH_FILE" assert_file_not_contains ".env.local.default" "DOCKER_USER" assert_file_not_contains ".env.local.default" "DOCKER_PASS" @@ -806,8 +805,6 @@ assert_files_present_no_integration_lagoon() { assert_file_not_contains "docker-compose.yml" "lagoon.type: solr" assert_file_not_contains "docker-compose.yml" "lagoon.type: none" - assert_file_not_contains ".env.local.default" "DREVOPS_DB_DOWNLOAD_SSH_FILE=" - popd >/dev/null || exit 1 } diff --git a/.scaffold/tests/bats/fixtures/docker-compose.env_local.json b/.scaffold/tests/bats/fixtures/docker-compose.env_local.json index 4fc2d5d51..512425b03 100644 --- a/.scaffold/tests/bats/fixtures/docker-compose.env_local.json +++ b/.scaffold/tests/bats/fixtures/docker-compose.env_local.json @@ -39,7 +39,6 @@ "DREVOPS_DB_DOWNLOAD_FTP_PORT": "21", "DREVOPS_DB_DOWNLOAD_FTP_USER": "", "DREVOPS_DB_DOWNLOAD_SOURCE": "curl", - "DREVOPS_DB_DOWNLOAD_SSH_FILE": "HOME/.ssh/id_rsa", "DREVOPS_DB_FILE": "db.sql", "DREVOPS_DEPLOY_TYPES": "artifact", "DREVOPS_LAGOON_PRODUCTION_BRANCH": "main", @@ -121,7 +120,6 @@ "DREVOPS_DB_DOWNLOAD_FTP_PORT": "21", "DREVOPS_DB_DOWNLOAD_FTP_USER": "", "DREVOPS_DB_DOWNLOAD_SOURCE": "curl", - "DREVOPS_DB_DOWNLOAD_SSH_FILE": "HOME/.ssh/id_rsa", "DREVOPS_DB_FILE": "db.sql", "DREVOPS_DEPLOY_TYPES": "artifact", "DREVOPS_LAGOON_PRODUCTION_BRANCH": "main", @@ -205,7 +203,6 @@ "DREVOPS_DB_DOWNLOAD_FTP_PORT": "21", "DREVOPS_DB_DOWNLOAD_FTP_USER": "", "DREVOPS_DB_DOWNLOAD_SOURCE": "curl", - "DREVOPS_DB_DOWNLOAD_SSH_FILE": "HOME/.ssh/id_rsa", "DREVOPS_DB_FILE": "db.sql", "DREVOPS_DEPLOY_TYPES": "artifact", "DREVOPS_LAGOON_PRODUCTION_BRANCH": "main", @@ -296,7 +293,6 @@ "DREVOPS_DB_DOWNLOAD_FTP_PORT": "21", "DREVOPS_DB_DOWNLOAD_FTP_USER": "", "DREVOPS_DB_DOWNLOAD_SOURCE": "curl", - "DREVOPS_DB_DOWNLOAD_SSH_FILE": "HOME/.ssh/id_rsa", "DREVOPS_DB_FILE": "db.sql", "DREVOPS_DEPLOY_TYPES": "artifact", "DREVOPS_LAGOON_PRODUCTION_BRANCH": "main", @@ -384,7 +380,6 @@ "DREVOPS_DB_DOWNLOAD_FTP_PORT": "21", "DREVOPS_DB_DOWNLOAD_FTP_USER": "", "DREVOPS_DB_DOWNLOAD_SOURCE": "curl", - "DREVOPS_DB_DOWNLOAD_SSH_FILE": "HOME/.ssh/id_rsa", "DREVOPS_DB_FILE": "db.sql", "DREVOPS_DEPLOY_TYPES": "artifact", "DREVOPS_LAGOON_PRODUCTION_BRANCH": "main", @@ -482,7 +477,6 @@ "DREVOPS_DB_DOWNLOAD_FTP_PORT": "21", "DREVOPS_DB_DOWNLOAD_FTP_USER": "", "DREVOPS_DB_DOWNLOAD_SOURCE": "curl", - "DREVOPS_DB_DOWNLOAD_SSH_FILE": "HOME/.ssh/id_rsa", "DREVOPS_DB_FILE": "db.sql", "DREVOPS_DEPLOY_TYPES": "artifact", "DREVOPS_LAGOON_PRODUCTION_BRANCH": "main", @@ -590,7 +584,6 @@ "DREVOPS_DB_DOWNLOAD_FTP_PORT": "21", "DREVOPS_DB_DOWNLOAD_FTP_USER": "", "DREVOPS_DB_DOWNLOAD_SOURCE": "curl", - "DREVOPS_DB_DOWNLOAD_SSH_FILE": "HOME/.ssh/id_rsa", "DREVOPS_DB_FILE": "db.sql", "DREVOPS_DEPLOY_TYPES": "artifact", "DREVOPS_LAGOON_PRODUCTION_BRANCH": "main", diff --git a/scripts/drevops/download-db-lagoon.sh b/scripts/drevops/download-db-lagoon.sh index c6656e465..e7798157c 100755 --- a/scripts/drevops/download-db-lagoon.sh +++ b/scripts/drevops/download-db-lagoon.sh @@ -47,7 +47,7 @@ DREVOPS_DB_DOWNLOAD_LAGOON_REMOTE_FILE_CLEANUP="${DREVOPS_DB_DOWNLOAD_LAGOON_REM DREVOPS_DB_DOWNLOAD_SSH_FINGERPRINT="${DREVOPS_DB_DOWNLOAD_SSH_FINGERPRINT:-}" # Default SSH file used if custom fingerprint is not provided. -DREVOPS_DB_DOWNLOAD_SSH_FILE="${DREVOPS_DB_DOWNLOAD_SSH_FILE:-}" +DREVOPS_DB_DOWNLOAD_SSH_FILE="${DREVOPS_DB_DOWNLOAD_SSH_FILE:-${HOME}/.ssh/id_rsa}" # The SSH host of the Lagoon environment. DREVOPS_DB_DOWNLOAD_LAGOON_SSH_HOST="${DREVOPS_DB_DOWNLOAD_LAGOON_SSH_HOST:-ssh.lagoon.amazeeio.cloud}"