Why the db: pull command uses the same path on staging and local? #19
-
my config: ...
host('local')
->hostname('localhost')
->set('deploy_path', getcwd())
->set('db_databases', [
'database_default' => [
get('local_db')
]
]);
host('staging')
->hostname(get('staging_host'))
->user('myuser')
->port(22922)
->set('deploy_path', get('staging_path'))
->set('branch', get('staging_branch'))
->set('db_databases', [
'database_default' => [
get('staging_db')
]
]); at
Attempt to create the staging_path (get('staging_path')) directory locally instead of using local path (getcwd()). |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments
-
I have too little info to give you answer.
|
Beta Was this translation helpful? Give feedback.
-
Thank you for the answer.
"require-dev": {
"deployer/deployer": "^6.8",
"drupal/devel": "^4.1",
"drupal/drupal-extension": "^4.1",
"drupal/twig_xdebug": "^1.2",
"kint-php/kint": "^3.3",
"sourcebroker/deployer-extended-database": "^13.0"
}
namespace Deployer;
require 'recipe/drupal8.php';
new \SourceBroker\DeployerLoader\Load([
['path' => 'vendor/sourcebroker/deployer-instance/deployer'],
['path' => 'vendor/sourcebroker/deployer-extended-database/deployer'],
]); and yes, // Returns path to store database dumps on local stage.
set('db_storage_path_local', function () {
if (Configuration::getLocalHost()->getConfig()->get('db_storage_path_relative', false) == false) {
$dbStoragePathLocal = Configuration::getLocalHost()->getConfig()->get('deploy_path') . '/.dep/database/dumps';
} else {
$dbStoragePathLocal = Configuration::getLocalHost()->getConfig()->get('deploy_path') . '/'
. Configuration::getLocalHost()->getConfig()->get('db_storage_path_relative');
}
runLocally('[ -d ' . $dbStoragePathLocal . ' ] || mkdir -p ' . $dbStoragePathLocal);
return $dbStoragePathLocal;
}); |
Beta Was this translation helpful? Give feedback.
-
Found the problem. |
Beta Was this translation helpful? Give feedback.
-
You should not change Look on
|
Beta Was this translation helpful? Give feedback.
-
Ok but this is in contrast with the official documentation: |
Beta Was this translation helpful? Give feedback.
-
I do not understand why is this in contrast. The |
Beta Was this translation helpful? Give feedback.
-
Ok - I see what you mean. In fact I never used "default_stage" in the meaning it was created for. So always "dep deploy prod" and never "dep deploy". |
Beta Was this translation helpful? Give feedback.
-
Without such trick most of commands would be much more complicated. Examples:
So because I no not use "default_stage" for doing deploys then I use "default_stage" for simplifying database operations. |
Beta Was this translation helpful? Give feedback.
-
Ok, all clear. thank you @kszymukowicz ! |
Beta Was this translation helpful? Give feedback.
You should not change
default_stage
yourself. It is set automatically based on .env INSTANCE value!Look on
vendor/sourcebroker/deployer-instance/deployer/config/set.php