Skip to content
Snippets Groups Projects
Commit 351ce84b authored by jurgenhaas's avatar jurgenhaas
Browse files

Fix mysql backup context

parent dde12924
No related branches found
No related tags found
1 merge request!22Merging develop into main
Pipeline #525395 passed
......@@ -244,7 +244,7 @@ class Handler extends BaseHandler {
// Update config for production build.
if (getenv('LAKEDROPS_BUILD_NG') === 'yes') {
$config = $handler->getConfig();
$isStaging = !in_array(getenv('PROJECT_BRANCH_SANITIZED'), ['master', 'main'], TRUE);
$isStaging = !in_array(getenv('CI_COMMIT_REF_SLUG'), ['master', 'main'], TRUE);
$root = '/drupal/' . getenv('CI_PROJECT_ID') . '/' . getenv('CI_COMMIT_BRANCH');
$drupal = $this->config->readValue('drupal');
$drupal['live'] = $config->readValue('live');
......@@ -257,6 +257,7 @@ class Handler extends BaseHandler {
'schedule' => '5 0 * * *',
'command' => 'cd /var/www/html && /usr/local/bin/drush sql:dump --result-file=/var/backups/mysql/drupal.sql',
];
$crontabs['enable_mysql_backup'] = TRUE;
}
$crontabs['enable'] = (array_sum(array_map('count', $crontabs)) > 0);
$this->config->setValue('crontabs', $crontabs, FALSE);
......
......@@ -90,7 +90,7 @@ services:
- {{ projectroot }}/drush:/etc/drush
{% if drupal.live|default(0) %}
- {{ projectrootfiles }}:/data/default
{% if backup.enable|default(0) %}
{% if crontabs.enable_mysql_backup|default(0) %}
- {{ projectrootfiles }}/db:/var/backups/mysql
{% endif %}
{% endif %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment