diff --git a/.github/actions/install.sh b/.github/actions/install.sh index afda76c..148586e 100755 --- a/.github/actions/install.sh +++ b/.github/actions/install.sh @@ -1,11 +1,8 @@ #!/bin/sh -# Set GLPI_ENVIRONMENT_TYPE to testing inside the container -docker exec --user www-data glpi /bin/bash -c "export GLPI_ENVIRONMENT_TYPE=testing" - # install glpi database -docker exec --user www-data glpi /bin/bash -c "cd /var/www/glpi && php bin/console db:install -H db -u glpi -p glpi -d glpi -n -r" +docker exec --user www-data glpi /bin/bash -c "cd /var/www/glpi && GLPI_ENVIRONMENT_TYPE=testing php bin/console db:install -H db -u glpi -p glpi -d glpi -n -r" # install our plugin -docker exec --user www-data glpi /bin/bash -c "cd /var/www/glpi && php bin/console plugin:install -u glpi jamf" -docker exec --user www-data glpi /bin/bash -c "cd /var/www/glpi && php bin/console plugin:activate jamf" +docker exec --user www-data glpi /bin/bash -c "cd /var/www/glpi && GLPI_ENVIRONMENT_TYPE=testing php bin/console plugin:install -u glpi jamf" +docker exec --user www-data glpi /bin/bash -c "cd /var/www/glpi && GLPI_ENVIRONMENT_TYPE=testing php bin/console plugin:activate jamf" diff --git a/inc/migration.class.php b/inc/migration.class.php index fa5696b..2e32dc0 100644 --- a/inc/migration.class.php +++ b/inc/migration.class.php @@ -55,8 +55,8 @@ public function __construct($version) $this->glpiMigration = new Migration($version); $this->db = $DB; - if (!defined('GLPI_ENVIRONMENT_TYPE') && getenv('GLPI_ENVIRONMENT_TYPE') === 'testing') { - define('GLPI_ENVIRONMENT_TYPE', 'testing'); + if (!defined('GLPI_ENVIRONMENT_TYPE') && getenv('GLPI_ENVIRONMENT_TYPE') !== false) { + define('GLPI_ENVIRONMENT_TYPE', getenv('GLPI_ENVIRONMENT_TYPE')); } if (defined('GLPI_ENVIRONMENT_TYPE') && GLPI_ENVIRONMENT_TYPE === 'testing') { $this->api = new PluginJamfApiTest();