-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
181 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
composer.lock | ||
phpunit.xml | ||
vendor | ||
log | ||
Tests/App/cache | ||
Tests/App/logs | ||
|
||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace BFOS\SyncContentBundle\Tests\App; | ||
|
||
use Symfony\Component\HttpKernel\Kernel; | ||
use Symfony\Component\Config\Loader\LoaderInterface; | ||
|
||
class AppKernel extends Kernel | ||
{ | ||
public function registerBundles() | ||
{ | ||
$bundles = array( | ||
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), | ||
// new Symfony\Bundle\SecurityBundle\SecurityBundle(), | ||
// new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), | ||
|
||
// bundle to test | ||
new BFOS\SyncContentBundle\BFOSSyncContentBundle(), | ||
); | ||
|
||
return $bundles; | ||
} | ||
|
||
public function registerContainerConfiguration(LoaderInterface $loader) | ||
{ | ||
$loader->load(__DIR__.'/config/config.yml'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
framework: | ||
translator: { fallback: en } | ||
secret: secret | ||
# router: | ||
# resource: "%kernel.root_dir%/config/routing.yml" | ||
# strict_requirements: %kernel.debug% | ||
templating: | ||
engines: ['php'] | ||
default_locale: en | ||
session: ~ | ||
test: ~ | ||
|
||
bfos_sync_content: | ||
options: # Global options | ||
deployment: | ||
rsync_exclude: "%kernel.root_dir%/config/rsync_exclude.txt" | ||
pre_local_commands: | ||
- 'php app/console assetic:dump' | ||
post_local_commands: | ||
- 'rm -rf web/js web/css' | ||
#pre_remote_commands: | ||
# - './c' | ||
post_remote_commands: | ||
- 'php app/console cache:clear --env=prod --no-debug --no-warmup' | ||
- 'php app/console doctrine:schema:update --force --env=prod' | ||
- 'php app/console assets:install web --symlink' | ||
sync_content: | ||
content: | ||
- "web/uploads" | ||
# servers: "%kernel.root_dir%/config/deployment_sync_content.yml" | ||
# | ||
servers: | ||
staging: | ||
host: staging.mysite.com | ||
port: 22 | ||
user: mysite | ||
dir: /home/user/mysite | ||
options : # Server options, override the globals | ||
rsync_options: '-azC --force --delete --verbose --progress' | ||
production: | ||
host: www.mysite.com | ||
port: 22 | ||
user: mysite | ||
dir: /home/user/mysite | ||
options : # Server options, override the globals | ||
rsync_options: '-azC --force --delete --verbose --progress' | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
namespace BFOS\SyncContentBundle\Tests\Command; | ||
|
||
|
||
use BFOS\SyncContentBundle\Loader\ServerLoader; | ||
use BFOS\SyncContentBundle\Server\Server; | ||
use BFOS\SyncContentBundle\Server\ServerRegister; | ||
|
||
class ServerRegisterTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function testAddServerToServersListSuccessfully() | ||
{ | ||
// create a server register | ||
$register = new ServerRegister(new ServerLoader()); | ||
|
||
// create a server | ||
$server = new Server('www.test.com', 'webtest', '/home/vagrant', '123123'); | ||
|
||
// add a server to register | ||
$register->addServer('srv1', $server); | ||
|
||
// test the server was added | ||
$this->assertEquals(1, count($register->getServers()), 'Server not added.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
$loader = @include __DIR__ . '/../vendor/autoload.php'; | ||
if (!$loader) { | ||
die(<<<'EOT' | ||
You must set up the project dependencies, run the following commands: | ||
wget http://getcomposer.org/composer.phar | ||
php composer.phar install | ||
EOT | ||
); | ||
} | ||
|
||
passthru(sprintf('rm -rf %s/App/cache', __DIR__)); | ||
spl_autoload_register(function($class) { | ||
if (0 === strpos($class, 'BFOS\\SyncContentBundle\\')) { | ||
$path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 2)).'.php'; | ||
if (!stream_resolve_include_path($path)) { | ||
return false; | ||
} | ||
require_once $path; | ||
|
||
return true; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit bootstrap="./Tests/bootstrap.php" colors="true"> | ||
<php> | ||
<server name="KERNEL_DIR" value="Tests/App" /> | ||
</php> | ||
|
||
<testsuites> | ||
<testsuite name="BFOSSyncContentBundle test suite"> | ||
<directory suffix="Test.php">./Tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory>./</directory> | ||
<exclude> | ||
<directory>./Resources</directory> | ||
<directory>./Tests</directory> | ||
<directory>./vendor</directory> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |