Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
cconard96 committed Apr 12, 2024
1 parent 550cde8 commit e85c235
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
9 changes: 3 additions & 6 deletions .github/actions/install.sh
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 2 additions & 2 deletions inc/migration.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit e85c235

Please sign in to comment.