Travis: debug installation

pull/3064/head
Julio 6 years ago
parent b5075feb3c
commit a523d8c25f
  1. 1
      .travis.yml
  2. 10
      public/main/install/index.php
  3. 1
      public/main/install/install.lib.php
  4. 3
      tests/behat/features/actionInstall.feature
  5. 4
      tests/travis/travis-apache

@ -80,7 +80,6 @@ install:
script: script:
- composer analyse - composer analyse
- curl $VHOST_URL/check.php
- cd tests/behat - cd tests/behat
# - travis_wait 45 ../../vendor/behat/behat/bin/behat -v # - travis_wait 45 ../../vendor/behat/behat/bin/behat -v
- ../../vendor/behat/behat/bin/behat features/actionInstall.feature - ../../vendor/behat/behat/bin/behat features/actionInstall.feature

@ -269,6 +269,8 @@ if (!$_POST) {
$current_step = 7; $current_step = 7;
} }
error_log("Step: $current_step");
// Managing the $encryptPassForm // Managing the $encryptPassForm
if ($encryptPassForm == '1') { if ($encryptPassForm == '1') {
$encryptPassForm = 'bcrypt'; $encryptPassForm = 'bcrypt';
@ -582,6 +584,8 @@ if (isset($_POST['step2'])) {
error_log('Set upgradeWithContainer'); error_log('Set upgradeWithContainer');
} else { } else {
set_file_folder_permissions(); set_file_folder_permissions();
error_log("connectToDatabase as user $dbUsernameForm");
$database = connectToDatabase( $database = connectToDatabase(
$dbHostForm, $dbHostForm,
$dbUsernameForm, $dbUsernameForm,
@ -593,8 +597,12 @@ if (isset($_POST['step2'])) {
$dbNameForm = preg_replace('/[^a-zA-Z0-9_\-]/', '', $dbNameForm); $dbNameForm = preg_replace('/[^a-zA-Z0-9_\-]/', '', $dbNameForm);
// Drop and create the database anyways // Drop and create the database anyways
error_log("Drop database $dbNameForm");
$manager->getConnection()->getSchemaManager()->dropAndCreateDatabase($dbNameForm); $manager->getConnection()->getSchemaManager()->dropAndCreateDatabase($dbNameForm);
error_log("Connect to database $dbNameForm with user $dbUsernameForm");
$database = connectToDatabase( $database = connectToDatabase(
$dbHostForm, $dbHostForm,
$dbUsernameForm, $dbUsernameForm,
@ -622,11 +630,13 @@ if (isset($_POST['step2'])) {
updateEnvFile($distFile, $envFile, $params); updateEnvFile($distFile, $envFile, $params);
(new Dotenv())->load($envFile); (new Dotenv())->load($envFile);
error_log("Boot kernel");
// Load Symfony Kernel // Load Symfony Kernel
$kernel = new Kernel('dev', true); $kernel = new Kernel('dev', true);
$application = new Application($kernel); $application = new Application($kernel);
// Create database // Create database
error_log("Create database");
$input = new ArrayInput([]); $input = new ArrayInput([]);
$command = $application->find('doctrine:schema:create'); $command = $application->find('doctrine:schema:create');
$result = $command->run($input, new ConsoleOutput()); $result = $command->run($input, new ConsoleOutput());

@ -2840,6 +2840,7 @@ function updateEnvFile($distFile, $envFile, $params)
$contents = file_get_contents($distFile); $contents = file_get_contents($distFile);
$contents = str_replace(array_keys($params), array_values($params), $contents); $contents = str_replace(array_keys($params), array_values($params), $contents);
file_put_contents($envFile, $contents); file_put_contents($envFile, $contents);
error_log("File env saved here: $envFile");
} }
/** /**

@ -23,7 +23,8 @@ Feature: Install portal
| passForm | admin | | passForm | admin |
Then I press "step5" Then I press "step5"
Then I should see "Last check before install" Then I should see "Last check before install"
Then I press "Install chamilo" Then wait the page to be loaded when ready
Then I press "button_step6"
Then wait the page to be loaded when ready Then wait the page to be loaded when ready
Then I should see "Step7" Then I should see "Step7"

@ -8,10 +8,6 @@
Require all granted Require all granted
</Directory> </Directory>
#ErrorLog ${APACHE_LOG_DIR}/%VHOST_URL%-error.log
LogLevel notice
#CustomLog ${APACHE_LOG_DIR}/%VHOST_URL%-access.log combined
<IfModule mod_fastcgi.c> <IfModule mod_fastcgi.c>
AddHandler php5-fcgi .php AddHandler php5-fcgi .php
Action php5-fcgi /php5-fcgi Action php5-fcgi /php5-fcgi

Loading…
Cancel
Save