deployer/tests/bootstrap.php

41 lines
1.2 KiB
PHP
Raw Normal View History

2013-07-11 15:47:09 +04:00
<?php
2015-06-12 23:23:30 +07:00
$loaded = false;
2015-06-17 19:30:25 +02:00
foreach ([__DIR__ . '/../../../autoload.php', __DIR__ . '/../vendor/autoload.php'] as $file) {
2015-06-12 23:23:30 +07:00
if (file_exists($file)) {
require $file;
$loaded = true;
break;
}
}
2015-06-12 23:23:30 +07:00
if (!$loaded) {
die(
'You need to set up the project dependencies using the following commands:' . PHP_EOL .
2020-04-25 23:00:08 +03:00
'composer install' . PHP_EOL
2015-06-12 23:23:30 +07:00
);
}
2017-03-16 20:03:11 +07:00
2020-10-10 10:50:45 +02:00
// For loading recipes
set_include_path(__DIR__ . '/..' . PATH_SEPARATOR . get_include_path());
putenv('DEPLOYER_LOCAL_WORKER=true');
define('DEPLOYER_BIN', __DIR__ . '/../bin/dep');
define('__FIXTURES__', __DIR__ . '/fixtures');
define('__REPOSITORY__', __DIR__ . '/fixtures/repository');
define('__TEMP_DIR__', sys_get_temp_dir() . '/deployer');
2020-10-09 00:15:28 +02:00
2022-03-13 17:08:44 +01:00
require_once __DIR__ . '/legacy/AbstractTest.php';
require_once __DIR__ . '/joy/JoyTest.php';
// Init repository
2020-10-10 10:50:45 +02:00
$repository = __REPOSITORY__;
2020-10-09 00:15:28 +02:00
`cd $repository && git init`;
$branch = trim(`git rev-parse --abbrev-ref HEAD`);
`cd $repository && git checkout -B $branch 2>&1`;
`cd $repository && git add .`;
`cd $repository && git config user.name 'Anton Medvedev'`;
`cd $repository && git config user.email 'anton.medv@example.com'`;
`cd $repository && git commit -m 'first commit'`;