Skip to content

Commit

Permalink
Merge branch 'release/3.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pingers committed Jun 17, 2019
2 parents b0100a9 + 6e214c1 commit 25c40e7
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 21 deletions.
15 changes: 0 additions & 15 deletions RoboFileBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ protected function readConfigFromEnv() {

// Environment.
$config['environment']['hash_salt'] = getenv('HASH_SALT');
$config['environment']['config_sync_dir'] = getenv('CONFIG_SYNC_DIRECTORY');

// Clean up NULL values and empty arrays.
$array_clean = function (&$item) use (&$array_clean) {
Expand All @@ -155,7 +154,6 @@ public function build() {
$start = new DateTime();
$this->devComposerValidate();
$this->buildMake();
$this->buildCreateConfigSyncDir();
$this->buildSetFilesOwner();
$this->buildInstall();
$this->configImportPlus();
Expand Down Expand Up @@ -197,19 +195,6 @@ public function buildMake($flags = '') {
$this->checkFail($successful, "Composer install failed.");
}

/**
* Create the config sync directory from config.
*
* Drupal will write a .htaccess afterwards in there.
*/
public function buildCreateConfigSyncDir() {
if (isset($this->config['environment']['config_sync_dir'])) {
// Only do this if we have a config sync dir setting available.
$this->say("Creating config sync directory.");
$this->_exec("$this->sudo_cmd mkdir -p " . $this->config['environment']['config_sync_dir']);
}
}

/**
* Set the owner and group of all files in the files dir to the web user.
*/
Expand Down
8 changes: 7 additions & 1 deletion docker-compose.linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ services:
ports:
- "80:8080"
environment:
CONFIG_SYNC_DIRECTORY: /shared/private/random-hash/sync
DATABASE_HOST: db
DATABASE_USER: user
DATABASE_PASSWORD: password
Expand All @@ -25,6 +24,7 @@ services:
PUBLIC_DIR: /shared/public
REDIS_ENABLED: 1
REDIS_HOST: redis
# REDIS_PASSWORD: testing
SHEPHERD_SITE_ID: 2
SHEPHERD_INSTALL_PROFILE: ua
SHEPHERD_SECRET_PATH: /code/private
Expand Down Expand Up @@ -66,6 +66,12 @@ services:

redis:
image: redis:alpine
command: |
redis-server
--maxmemory 512Mi
--maxmemory-policy allkeys-lru
--save ""
# --requirepass password
networks:
- default

Expand Down
10 changes: 8 additions & 2 deletions docker-compose.osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ services:
- "9990:9990"
- "11211:11211"
environment:
CONFIG_SYNC_DIRECTORY: /shared/private/random-hash/sync
HASH_SALT: random-hash
MEMCACHE_ENABLED: 0
PHP_IDE_CONFIG: serverName=localhost
PUBLIC_DIR: /shared/public
REDIS_ENABLED: 1
# REDIS_PASSWORD: testing
SHEPHERD_INSTALL_PROFILE: ua
SHEPHERD_SITE_ID: 2
SHEPHERD_SECRET_PATH: /code/private
Expand All @@ -33,7 +34,6 @@ services:
SITE_ADMIN_EMAIL: [email protected]
SITE_ADMIN_USERNAME: admin
SITE_ADMIN_PASSWORD: password
PHP_IDE_CONFIG: serverName=localhost
XDEBUG_CONFIG: "remote_host=docker.for.mac.localhost"
volumes:
- nfsmount:/code
Expand Down Expand Up @@ -61,6 +61,12 @@ services:

redis:
image: redis:alpine
command: |
redis-server
--maxmemory 512Mi
--maxmemory-policy allkeys-lru
--save ""
# --requirepass password
network_mode: service:web

memcached:
Expand Down
3 changes: 2 additions & 1 deletion dsh
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ dsh_project() {
# Command: ./dsh pull
# Fetches all images used by the project.
dsh_pull() {
docker-compose -f ${DOCKER_COMPOSE_FILE} pull
docker-compose -f ${DOCKER_COMPOSE_FILE} pull --ignore-pull-failures
docker-compose -f ${DOCKER_COMPOSE_FILE} build
}

# Command: ./dsh nfs
Expand Down
7 changes: 5 additions & 2 deletions src/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function generateSettings()
"\$settings['file_private_path'] = getenv('PRIVATE_DIR') ?: '/shared/private';\n" .
"\$settings['file_temporary_path'] = getenv('TMP_DIR') ?: '/shared/tmp';\n" .
"\$settings['hash_salt'] = getenv('HASH_SALT') ?: '" . str_replace(['+', '/', '='], ['-', '_', ''], base64_encode(random_bytes(55))) . "';\n" .
"\$config_directories['sync'] = getenv('CONFIG_SYNC_DIRECTORY') ?: DRUPAL_ROOT . '/../config-export';\n" .
"\$config_directories['sync'] = DRUPAL_ROOT . '/../config-export';\n" .
"\$settings['shepherd_site_id'] = getenv('SHEPHERD_SITE_ID');\n" .
"\$settings['shepherd_url'] = getenv('SHEPHERD_URL');\n" .
"\$settings['shepherd_token'] = getenv('SHEPHERD_TOKEN_FILE') ? file_get_contents(getenv('SHEPHERD_TOKEN_FILE')) : getenv('SHEPHERD_TOKEN');\n\n" .
Expand All @@ -177,9 +177,12 @@ public function generateSettings()
" \$settings['cache_prefix']['default'] = getenv('REDIS_PREFIX') ?: '';\n" .
" // If we're not installing, include the redis services.\n" .
" if (!isset(\$GLOBALS['install_state'])) {\n" .
" \$settings['cache']['default'] = 'cache.backend.redis';\n\n" .
" \$settings['cache']['default'] = 'cache.backend.redis';\n" .
" \$settings['container_yamls'][] = 'modules/contrib/redis/example.services.yml';\n" .
" }\n" .
" if (getenv('REDIS_PASSWORD_FILE') || getenv('REDIS_PASSWORD')) {\n" .
" \$settings['redis.connection']['password'] = getenv('REDIS_PASSWORD_FILE') ? file_get_contents(getenv('REDIS_PASSWORD_FILE')) : getenv('REDIS_PASSWORD');\n" .
" }\n" .
"}\n" .
"if (getenv('MEMCACHE_ENABLED')) {\n" .
" \$settings['memcache']['servers'] = [getenv('MEMCACHE_HOST') . ':11211' => 'default'] ?: ['127.0.0.1:11211' => 'default'];\n" .
Expand Down

0 comments on commit 25c40e7

Please sign in to comment.