Skip to content

Commit

Permalink
Laravel 5 - 5.4 version
Browse files Browse the repository at this point in the history
Signed-off-by: Fadion Dashi <[email protected]>
  • Loading branch information
fadion committed Dec 8, 2017
1 parent e420c27 commit 79947c6
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 63 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/vendor
composer.phar
composer.lock
.DS_Store
.DS_Store
.idea
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
> Maneuver was recently updated to use SFTP, in addition to FTP. This change doesn't break any API, except a few simple configuration changes. You'll need to add a `scheme` option to your servers with either `ftp` or `ssh` as a value. In addition, the `username` field will have to be renamed to `user` and `password` to `pass`.
> This release is tagged with a version. Please update your composer as instructed in the [Installation](#installation) section.
> To use it in Laravel 5, please see the `l5` branch.
# Maneuver

A Laravel package that makes deployment as easy as it has never been. It uses Git to read file changes and deploys to your server(s) via FTP or SFTP. **Why Git?** Because anyone should already version their files and if they do, it's almost certain they're using Git. **Why FTP?** Because it is the easiest transport protocol to implement and use.
Expand All @@ -29,18 +23,18 @@ Maneuver solves these problems with a very simple approach. It takes the best of
```json
{
"require": {
"fadion/maneuver": "~1.0"
"fadion/maneuver": "2.0.*"
}
}
```

2. Add `Fadion\Maneuver\ManeuverServiceProvider` to your `app/config/app.php` file, inside the `providers` array.

3. Publish the package's config with `php artisan config:publish fadion/maneuver`, so you can easily modify it in: `app/config/packages/fadion/maneuver/config.php`
3. Publish the package's config with `php artisan vendor:publish`, so you can easily modify it in: `config/maneuver.php`.

## Configuration

The first step is to add servers in the configuration file. If you followed step 3 above, you'll find it in `app/config/packages/fadion/maneuver/config.php`.
The first step is to add servers in the configuration file. If you followed step 3 above, you'll find it in `config/maneuver.php`.

Add one or more servers in the `connections` array, providing a unique, recognizable name for each. Credentials should obviously be entered too. Optionally, specify a default server for deployment, by entering the server's name in the `default` option. Changes will be deployed to that server if not overriden. In case you leave the `default` option empty, deployment will be run to all the servers.

Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
}
],
"require": {
"php": ">=5.4.0",
"illuminate/support": "4.2.*",
"illuminate/console": "4.2.*",
"illuminate/config": "4.2.*",
"banago/bridge": "~1.0.6",
"php": ">=5.5.0",
"illuminate/support": "5.*",
"illuminate/console": "5.*",
"illuminate/config": "5.*",
"banago/bridge": "~1.0.8",
"jakeasmith/http_build_url": "~0.1.2"
},
"autoload": {
Expand All @@ -29,4 +29,4 @@
}
},
"minimum-stability": "stable"
}
}
4 changes: 2 additions & 2 deletions src/Fadion/Maneuver/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class Connection {
public function __construct($server = null)
{
// Load connections array from config.
$connections = app()->config['maneuver::config.connections'];
$default = app()->config['maneuver::config.default'];
$connections = config('maneuver.connections');
$default = config('maneuver.default');

if (!$connections) {
throw new Exception("Connections list not set or empty. Please fill it with servers in Maneuver's config.");
Expand Down
2 changes: 1 addition & 1 deletion src/Fadion/Maneuver/Git.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function __construct($repo = null, $rollback)
$this->subModules();

// Load the ignored files array from config.
$ignored = app()->config['maneuver::config.ignored'];
$ignored = config('maneuver.ignored');

if ($ignored) {
foreach ($ignored as $file) {
Expand Down
76 changes: 32 additions & 44 deletions src/Fadion/Maneuver/ManeuverServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
class ManeuverServiceProvider extends ServiceProvider
{

/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;

/**
* Boot the service provider.
Expand All @@ -23,46 +23,34 @@ class ManeuverServiceProvider extends ServiceProvider
*/
public function boot()
{
$this->package('fadion/maneuver');
$this->publishes([
__DIR__ . '/../../config/config.php' => config_path('maneuver.php')
]);
}

/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app['artisan.maneuver.deploy'] = $this->app->share(function($app) {
return new DeployCommand;
});

$this->app['artisan.maneuver.list'] = $this->app->share(function($app) {
return new ListCommand;
});

$this->app['artisan.maneuver.rollback'] = $this->app->share(function($app) {
return new RollbackCommand;
});

$this->app['artisan.maneuver.sync'] = $this->app->share(function($app) {
return new SyncCommand;
});

$this->commands('artisan.maneuver.deploy');
$this->commands('artisan.maneuver.list');
$this->commands('artisan.maneuver.rollback');
$this->commands('artisan.maneuver.sync');
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->commands([
Commands\DeployCommand::class,
Commands\ListCommand::class,
Commands\RollbackCommand::class,
Commands\SyncCommand::class,
]);
}

/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return array('maneuver');
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return array('maneuver');
}

}

0 comments on commit 79947c6

Please sign in to comment.