Skip to content

Commit

Permalink
Support more middleware environments (#32)
Browse files Browse the repository at this point in the history
* Add support for multiple environments.

* Clean up.

* Create a way to use pull secrets without specifiying environment or id.

* Ensure that there is always a directory separator
  • Loading branch information
bart88 authored May 25, 2018
1 parent 8bf64a3 commit b6d78fd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,13 @@ public function modifySettingsFile()
" \$settings['container_yamls'][] = 'modules/contrib/redis/example.services.yml';\n" .
" }\n" .
"}\n" .
"\$settings['ua_middleware_service'] = array(\n" .
" 'auth' => getenv('UA_MIDDLEWARE_AUTH_FILE') ? file_get_contents(getenv('UA_MIDDLEWARE_AUTH_FILE')) : getenv('UA_MIDDLEWARE_AUTH'),\n" .
");\n" .
"if (getenv('UA_MW_SECRET_PATH')) {\n" .
" \$settings['ua_middleware_service'] = []; \n" .
" // Glob the secret path for secrets, that match pattern \n" .
" foreach( glob( rtrim(getenv('UA_MW_SECRET_PATH'),DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'UA_MW_*') as \$secret) {\n" .
" \$settings['ua_middleware_service'][pathinfo(\$secret)['filename']] = file_get_contents(\$secret);\n" .
" }\n" .
"}\n" .
"/**\n * END SHEPHERD CONFIG\n */\n" .
"\n" .
"/**\n * START LOCAL CONFIG\n */\n" .
Expand Down

0 comments on commit b6d78fd

Please sign in to comment.