-
Notifications
You must be signed in to change notification settings - Fork 8
Edits for cloud.gov configuration #167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
2b6101d
e635574
680112e
a28b560
4b02fff
f10e9b4
dc073d1
192c979
bf15e16
3318f5c
228b62f
08e4409
5240738
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "COMPOSER_INSTALL_OPTIONS": [ | ||
| "--no-dev --optimize-autoloader --no-progress --no-interaction" | ||
| ], | ||
| "COMPOSER_VENDOR_DIR": "vendor", | ||
| "WEBDIR": "web", | ||
| "PHP_EXTENSIONS": ["bz2", "zlib", "curl", "mcrypt", "gd", "pdo", "pdo_mysql", "mbstring"], | ||
| "ADDITIONAL_PREPROCESS_CMDS": [ | ||
| "$HOME/bootstrap.sh" | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| ; Maximum amount of memory a script may consume (128MB) | ||
| ; http://php.net/memory-limit | ||
| memory_limit = 512M |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,38 +1,23 @@ | ||
| #!/bin/bash | ||
| set -euxo pipefail | ||
| set -euo pipefail | ||
|
|
||
| : ${ACCOUNT_NAME?} ${ACCOUNT_PASS?} | ||
| install_drupal() { | ||
| ACCOUNT_NAME=$(echo $VCAP_SERVICES | jq -r '.["user-provided"][] | select(.name == "secrets") | .credentials.ROOT_USER_NAME') | ||
| ACCOUNT_PASS=$(echo $VCAP_SERVICES | jq -r '.["user-provided"][] | select(.name == "secrets") | .credentials.ROOT_USER_PASS') | ||
|
|
||
| fail() { | ||
| echo FAIL $@ | ||
| exit 1 | ||
| } | ||
|
|
||
| bootstrap() { | ||
| creds=$(echo $VCAP_SERVICES | jq -r '.["aws-rds"][0].credentials') | ||
| [ $creds = "null" ] && fail "creds are null; need to bind database?" | ||
|
|
||
| db_type=mysql | ||
| db_user=$(echo $creds | jq -r '.username') | ||
| db_pass=$(echo $creds | jq -r '.password') | ||
| db_port=$(echo $creds | jq -r '.port') | ||
| db_host=$(echo $creds | jq -r '.host') | ||
| db_name=$(echo $creds | jq -r '.db_name') | ||
| : "${ACCOUNT_NAME:?Need and root user name for Drupal}" | ||
| : "${ACCOUNT_PASS:?Need and root user pass for Drupal}" | ||
|
|
||
| drupal site:install standard --root=$HOME/web --no-interaction \ | ||
| --account-name=${ACCOUNT_NAME:-$(gen_cred ACCOUNT_NAME)} \ | ||
| --account-pass=${ACCOUNT_PASS:-$(gen_cred ACCOUNT_PASS)} \ | ||
| --langcode="en" \ | ||
| --db-type=$db_type \ | ||
| --db-user=$db_user \ | ||
| --db-pass=$db_pass \ | ||
| --db-port=$db_port \ | ||
| --db-host=$db_host \ | ||
| --db-name=$db_name | ||
| drupal site:install \ | ||
| --root=$HOME/web \ | ||
| --no-interaction \ | ||
| --account-name="$ACCOUNT_NAME" \ | ||
| --account-pass="$ACCOUNT_PASS" \ | ||
| --langcode="en" | ||
| } | ||
|
|
||
| drush --root=$HOME/web core-status bootstrap | grep -q "Successful" || bootstrap | ||
|
|
||
| drush --root=$HOME/web pm-info flysystem_s3 --fields=Status | grep -q enabled || | ||
| drush --root=$HOME/web pm-enable --yes flysystem_s3 | ||
|
|
||
| if [ "$CF_INSTANCE_INDEX" == "0" ]; then | ||
| drupal --root=$HOME/web list | grep database > /dev/null || install_drupal | ||
| # load configs here | ||
| # drupal --root=$HOME/web config:import ... | ||
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,75 +1,87 @@ | ||
| { | ||
| "name": "drupal/drupal", | ||
| "description": "Drupal is an open source content management platform powering millions of websites and applications.", | ||
| "name": "18f/nsf", | ||
| "description": "Project template for Drupal 8 projects with composer", | ||
| "type": "project", | ||
| "license": "GPL-2.0+", | ||
| "authors": [ | ||
| { | ||
| "name": "", | ||
| "role": "" | ||
| } | ||
| ], | ||
| "repositories": [ | ||
| { | ||
| "type": "composer", | ||
| "url": "https://packages.drupal.org/8" | ||
| } | ||
| ], | ||
| "require": { | ||
| "composer/installers": "^1.0.24", | ||
| "wikimedia/composer-merge-plugin": "^1.4", | ||
| "drush/drush": "^9.1", | ||
| "drupal/features": "^3.5", | ||
| "php": "^7.1.0", | ||
| "composer/installers": "^1.2", | ||
| "cweagans/composer-patches": "^1.6", | ||
| "drupal-composer/drupal-scaffold": "^2.2", | ||
| "drupal/brightcove": "^1.3", | ||
| "drupal/inline_entity_form": "^1.0@beta", | ||
| "drupal/time_formatter": "1.x-dev", | ||
| "drupal/entity_embed": "^1.0", | ||
| "drupal/console": "^1.0.2", | ||
| "drupal/core": "~8.4", | ||
| "drupal/ctools": "^3.0", | ||
| "drupal/embed": "^1.0", | ||
| "drupal/entity_browser": "^2.0", | ||
| "drupal/ctools": "^3.0", | ||
| "drupal/media_entity": "^1.7" | ||
| "drupal/features": "^3.5", | ||
| "drupal/flysystem_s3": "^1.0@alpha", | ||
| "drupal/inline_entity_form": "^1.0@beta", | ||
| "drupal/media_entity": "^1.7", | ||
| "drupal/time_formatter": "1.x-dev", | ||
| "drush/drush": "~8.0|^9.0.0-beta8", | ||
| "webflo/drupal-finder": "^1.0.0", | ||
| "webmozart/path-util": "^2.3" | ||
| }, | ||
| "replace": { | ||
| "drupal/core": "^8.4" | ||
| "require-dev": { | ||
|
||
| "behat/mink": "~1.7", | ||
| "behat/mink-goutte-driver": "~1.2", | ||
| "jcalderonzumba/gastonjs": "~1.0.2", | ||
| "jcalderonzumba/mink-phantomjs-driver": "~0.3.1", | ||
| "mikey179/vfsstream": "~1.2", | ||
| "phpunit/phpunit": ">=4.8.28 <5", | ||
| "symfony/css-selector": "~2.8|~3.0" | ||
| }, | ||
| "conflict": { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cmc333333 I'm surprised to see
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure thing -- and my understanding of this is definitely hazy, so apologies ahead of time. This all stems from cloud.gov using a different code generator ( |
||
| "drupal/drupal": "*" | ||
| }, | ||
| "minimum-stability": "dev", | ||
| "prefer-stable": true, | ||
| "config": { | ||
| "preferred-install": "dist", | ||
| "autoloader-suffix": "Drupal8" | ||
| }, | ||
| "extra": { | ||
| "_readme": [ | ||
| "By default Drupal loads the autoloader from ./vendor/autoload.php.", | ||
| "To change the autoloader you can edit ./autoload.php.", | ||
| "This file specifies the packages.drupal.org repository.", | ||
| "You can read more about this composer repository at:", | ||
| "https://www.drupal.org/node/2718229" | ||
| ], | ||
| "merge-plugin": { | ||
| "include": [ | ||
| "core/composer.json", | ||
| "modules/brightcove/composer.json" | ||
| ], | ||
| "recurse": false, | ||
| "replace": false, | ||
| "merge-extra": false | ||
| }, | ||
| "installer-paths": { | ||
| "core": ["type:drupal-core"], | ||
| "modules/contrib/{$name}": ["type:drupal-module"], | ||
| "profiles/contrib/{$name}": ["type:drupal-profile"], | ||
| "themes/contrib/{$name}": ["type:drupal-theme"], | ||
| "drush/contrib/{$name}": ["type:drupal-drush"], | ||
| "modules/custom/{$name}": ["type:drupal-custom-module"], | ||
| "themes/custom/{$name}": ["type:drupal-custom-theme"] | ||
| } | ||
| "sort-packages": true | ||
| }, | ||
| "autoload": { | ||
| "psr-4": { | ||
| "Drupal\\Core\\Composer\\": "core/lib/Drupal/Core/Composer" | ||
| } | ||
| "classmap": [ | ||
| "scripts/composer/ScriptHandler.php" | ||
| ] | ||
| }, | ||
| "scripts": { | ||
| "pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump", | ||
| "post-autoload-dump": [ | ||
| "Drupal\\Core\\Composer\\Composer::ensureHtaccess" | ||
| "drupal-scaffold": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold", | ||
| "pre-install-cmd": [ | ||
| "DrupalProject\\composer\\ScriptHandler::checkComposerVersion" | ||
| ], | ||
| "pre-update-cmd": [ | ||
| "DrupalProject\\composer\\ScriptHandler::checkComposerVersion" | ||
| ], | ||
| "post-package-install": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup", | ||
| "post-package-update": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup" | ||
| "post-install-cmd": [ | ||
| "DrupalProject\\composer\\ScriptHandler::createRequiredFiles" | ||
| ], | ||
| "post-update-cmd": [ | ||
| "DrupalProject\\composer\\ScriptHandler::createRequiredFiles" | ||
| ] | ||
| }, | ||
| "repositories": [ | ||
| { | ||
| "type": "composer", | ||
| "url": "https://packages.drupal.org/8" | ||
| "extra": { | ||
| "installer-paths": { | ||
| "web/core": ["type:drupal-core"], | ||
| "web/libraries/{$name}": ["type:drupal-library"], | ||
| "web/modules/contrib/{$name}": ["type:drupal-module"], | ||
| "web/profiles/contrib/{$name}": ["type:drupal-profile"], | ||
| "web/themes/contrib/{$name}": ["type:drupal-theme"], | ||
| "web/drush/contrib/{$name}": ["type:drupal-drush"], | ||
| "web/modules/custom/{$name}": ["type:drupal-custom-module"], | ||
| "web/themes/custom/{$name}": ["type:drupal-custom-theme"] | ||
| } | ||
| ] | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cmc333333 How about something like
The National Science Foundation's beta site?