Skip to content

Commit

Permalink
Fix problems during installation process, set minimum-stability to alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-buzzwoo committed Jan 17, 2023
1 parent 4d6d6bd commit 304ea19
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 36 deletions.
16 changes: 8 additions & 8 deletions GoConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
'tag' => '7-3.14.4',
],
'memcached' => [
'enable' => 0,
'enable' => 1,
'tag' => '1-2.14.2',
],
'rsyslog' => [
Expand Down Expand Up @@ -117,7 +117,7 @@
'flood_control' => '^2.0', // https://www.drupal.org/project/flood_control
'config_pages' => '^2.0', // https://www.drupal.org/project/config_pages
'config_split' => '^2.0', // https://www.drupal.org/project/config_split
'config_ignore' => '^2.0', // https://www.drupal.org/project/config_ignore
// 'config_ignore' => '^2.0', // https://www.drupal.org/project/config_ignore (NOT AVAILABLE FOR D10)
// 'dblog_filter' => '^2.0', // https://www.drupal.org/project/dblog_filter (THROWS ERROR FOR D10)
'watchdog_prune' => '^2.0', // https://www.drupal.org/project/watchdog_prune
'stage_file_proxy' => '^2.0', // https://www.drupal.org/project/stage_file_proxy
Expand All @@ -127,9 +127,9 @@
'entity_redirect' => '^2.0', // https://www.drupal.org/project/entity_redirect
'entity_clone' => '^2.0', // https://www.drupal.org/project/entity_clone
'ultimate_cron' => '^2.0', // https://www.drupal.org/project/ultimate_cron
'customerror' => '^1.0', // https://www.drupal.org/project/customerror
'webform' => '^6.0', // https://www.drupal.org/project/webform
'maillog' => '^1.0', // https://www.drupal.org/project/maillog
// 'customerror' => '^1.0', // https://www.drupal.org/project/customerror (NOT AVAILABLE FOR D10)
// 'webform' => '^6.0', // https://www.drupal.org/project/webform
// 'maillog' => '^1.0', // https://www.drupal.org/project/maillog
// 'reroute_email' => '^1.0', // https://www.drupal.org/project/reroute_email
// 'scheduler' => '^2.0', // https://www.drupal.org/project/scheduler
// 'entity_type_clone' => '^1.0', // https://www.drupal.org/project/entity_type_clone
Expand All @@ -140,9 +140,9 @@
/**
* System and Development.
*/
'libraries' => '^4.0', // https://www.drupal.org/project/libraries
'twig_tweak' => '^3.0', // https://www.drupal.org/project/twig_tweak
'twig_field_value' => '^2.0', // https://www.drupal.org/project/twig_field_value
// 'libraries' => '^4.0', // https://www.drupal.org/project/libraries (THROWS AN ERROR ON INSTALLATION)
// 'node_revision_delete' => '^1.0', // https://www.drupal.org/project/node_revision_delete
// 'smtp' => '^1.0', // https://www.drupal.org/project/smtp
// 'mimemail' => '^1.0', // https://www.drupal.org/project/mimemail
Expand All @@ -159,7 +159,7 @@
'allowed_formats' => '^1.0', // https://www.drupal.org/project/allowed_formats
'ajax_loader' => '^2.0', // https://www.drupal.org/project/ajax_loader
'chosen' => '^3.0', // https://www.drupal.org/project/chosen
'linkit' => '^6.0', // https://www.drupal.org/project/linkit
// 'linkit' => '^6.0', // https://www.drupal.org/project/linkit (NOT AVAILABLE FOR D10)
'editor_advanced_link' => '^2.0', // https://www.drupal.org/project/editor_advanced_link
'link_field_autocomplete_filter' => '^2.0', // https://www.drupal.org/project/link_field_autocomplete_filter
'field_group' => '^3.0', // https://www.drupal.org/project/field_group
Expand Down Expand Up @@ -207,7 +207,7 @@
* More modules here: https://www.drupal.org/project/paragraphs/ecosystem.
*/
'paragraphs' => '^1.0', // https://www.drupal.org/project/paragraphs
'paragraphs_browser' => '^1.0', // https://www.drupal.org/project/paragraphs_browser
// 'paragraphs_browser' => '^1.0', // https://www.drupal.org/project/paragraphs_browser (NOT AVAILABLE FOR D10)
'entity_reference_revisions' => '^1.0', // https://www.drupal.org/project/entity_reference_revisions
'paragraphs_modal_edit' => '^1.0', // https://www.drupal.org/project/paragraphs_modal_edit
// 'paragraph_view_mode' => '^3.0', // https://www.drupal.org/project/paragraph_view_mode
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ The Drupal Go based on [Composer template for Drupal project](https://github.com
* `"[web-root]/robots.txt": false`
* `"[web-root]/.htaccess": false`
* `"[project-root]/.editorconfig": false`
9) Go to the `/admin/reports/status` page and check errors. Perhaps you need to install some missing libraries.

## Performance for Mac OS users:
If you want to improve performance, please read the [doc](https://wodby.com/docs/stacks/php/local/#user-guided-caching).
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nortmas/drupal-go",
"description": "Drupal 10 project.",
"version": "0.1.7",
"version": "1.0.0",
"require": {
"php": ">=8.1",
"digipolisgent/robo-drush": "^5.0",
Expand All @@ -20,7 +20,7 @@
"conflict": {
"drupal/drupal": "*"
},
"minimum-stability": "dev",
"minimum-stability": "alpha",
"prefer-stable": true,
"config": {
"discard-changes": true,
Expand Down
62 changes: 36 additions & 26 deletions go/GoRoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct() {
* Test function.
*/
public function test() {
$this->deploy_setup();
//$this->deploy_setup();
//$this->prepareComposerJson();
//$this->yell('Hello!');
}
Expand All @@ -65,27 +65,10 @@ public function enable_modules() {
}

/**
* Prepare
* Prepare.
*/
public function prepare() {
if ($this->config['memcached']['enable'] == FALSE) {
$memcached = $this->ask("Do you want to set up memcached? Y or N");
$this->config['memcached']['enable'] = strtolower($memcached) == 'y' ? 1 : 0;
$this->updateGoConf();
}

if ($this->config['behat']['enable'] == FALSE) {
$behat = $this->ask("Do you want to set up behat tests? Y or N");
$this->config['behat']['enable'] = strtolower($behat) == 'y' ? 1 : 0;
$this->updateGoConf();
}

if ($this->config['deploy']['enable'] == FALSE) {
$behat = $this->ask("Do you want to set up deployment flow? Y or N");
$this->config['deploy']['enable'] = strtolower($behat) == 'y' ? 1 : 0;
$this->updateGoConf();
}

//$this->areYouSure();
$this->configureProject(TRUE);
}

Expand All @@ -111,6 +94,10 @@ public function go() {
$this->crontab_setup();
}
$this->removeNeedlessModules();

$this->set_correct_permissions();
$this->set_settings_writable();

$message = 'Available domains: ';
$domains = $this->getDomains();
foreach (explode(',', $domains) as $domain) {
Expand Down Expand Up @@ -409,6 +396,29 @@ public function push_files($alias) {
$this->commandExec($drush_sync);
}

/**
* Make sure user configured the setting file correctly and ask one more time.
*/
protected function areYouSure() {
if ($this->config['memcached']['enable'] == FALSE) {
$memcached = $this->ask("Do you want to set up memcached? Y or N");
$this->config['memcached']['enable'] = strtolower($memcached) == 'y' ? 1 : 0;
$this->updateGoConf();
}

if ($this->config['behat']['enable'] == FALSE) {
$behat = $this->ask("Do you want to set up behat tests? Y or N");
$this->config['behat']['enable'] = strtolower($behat) == 'y' ? 1 : 0;
$this->updateGoConf();
}

if ($this->config['deploy']['enable'] == FALSE) {
$behat = $this->ask("Do you want to set up deployment flow? Y or N");
$this->config['deploy']['enable'] = strtolower($behat) == 'y' ? 1 : 0;
$this->updateGoConf();
}
}

/**
* Wrapper to execute command inside container.
*
Expand Down Expand Up @@ -527,11 +537,9 @@ protected function createSettingsFile($file_settings = NULL, $file_def_settings
'value' => Crypt::randomBytesBase64(55),
'required' => TRUE,
];
$settings['config_directories'] = [
'settings' => (object) [
'value' => Path::makeRelative($this->projectRoot . '/config/default', $this->drupalRoot),
'required' => TRUE,
],
$settings['settings']['config_sync_directory'] = (object) [
'value' => Path::makeRelative($this->projectRoot . '/config/default', $this->drupalRoot),
'required' => TRUE,
];
}

Expand Down Expand Up @@ -1177,13 +1185,15 @@ protected function installModules() {
return;
}

$ignore = $this->ask("Do you want to ignore module versions specified in the GoConfig.php and install the newest? Y or N");

foreach ($this->config['modules'] as $name => $version) {
$version = strtolower($ignore) == 'y' ? null : $version;
$this->taskComposerRequire()->dependency('drupal/' . $name, $version)->run();
}

$this->enableModules();
}

/**
* Install modules.
*/
Expand Down

0 comments on commit 304ea19

Please sign in to comment.