Skip to content

Commit 9781509

Browse files
authored
Merge pull request #22 from universityofadelaide/feature/add-tmp-dir-support
add tmp dir support
2 parents 0b5ae3f + dbe8261 commit 9781509

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

RoboFileBase.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ abstract class RoboFileBase extends \Robo\Tasks {
2727
protected $application_root = "web";
2828
protected $file_public_path = '/shared/public';
2929
protected $file_private_path = '/shared/private';
30+
protected $file_temporary_path = '/shared/tmp';
3031
protected $services_yml = "web/sites/default/services.yml";
3132
protected $settings_php = "web/sites/default/settings.php";
3233

@@ -178,8 +179,10 @@ public function buildSetFilesOwner() {
178179
$this->say("Setting files directory owner.");
179180
$this->_exec("$this->sudo_cmd chown $this->web_server_user:$this->local_user -R $this->file_public_path");
180181
$this->_exec("$this->sudo_cmd chown $this->web_server_user:$this->local_user -R $this->file_private_path");
182+
$this->_exec("$this->sudo_cmd chown $this->web_server_user:$this->local_user -R $this->file_temporary_path");
181183
$this->setPermissions($this->file_public_path, '0775');
182184
$this->setPermissions($this->file_private_path, '0775');
185+
$this->setPermissions($this->file_temporary_path, '0775');
183186
}
184187

185188
/**

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ services:
1717
DATABASE_USER: user
1818
DATABASE_PASSWORD: password
1919
PRIVATE_DIR: /shared/private
20+
TMP_DIR: /shared/tmp
2021
PUBLIC_DIR: web/sites/default/files
2122
HASH_SALT: random-hash
2223
CONFIG_SYNC_DIRECTORY: /shared/private/random-hash/sync

src/Handler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ public function modifySettingsFile()
133133
" 'collation' => getenv('DATABASE_COLLATION') ?: 'utf8mb4_general_ci',\n" .
134134
" 'namespace' => getenv('DATABASE_NAMESPACE') ?: 'Drupal\\\\Core\\\\Database\\\\Driver\\\\mysql',\n" .
135135
");\n" .
136-
"\$settings['file_private_path'] = getenv('PRIVATE_DIR');\n" .
136+
"\$settings['file_private_path'] = getenv('PRIVATE_DIR') ?: '/shared/private';\n" .
137+
"\$settings['file_temporary_path'] = getenv('TMP_DIR') ?: '/shared/tmp';\n" .
137138
"\$settings['hash_salt'] = getenv('HASH_SALT') ?: '" . str_replace(['+', '/', '='], ['-', '_', ''], base64_encode(random_bytes(55))) . "';\n" .
138139
"\$config_directories['sync'] = getenv('CONFIG_SYNC_DIRECTORY') ?: 'sites/default/files/config_".str_replace(['+', '/', '='], ['-', '_', ''], base64_encode(random_bytes(55))) . "/sync';\n" .
139140
"if (! is_dir(\$app_root . '/' . \$config_directories['sync'])) mkdir(\$app_root . '/' . \$config_directories['sync'], 0777, true);\n" .

0 commit comments

Comments
 (0)