Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] Rename the project to “Deploy Operations” from “Deploy Actions” #154

Merged
merged 5 commits into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -14,13 +14,13 @@ body:
attributes:
label: Environment
description: |
Tip: Use the `composer info dragon-code/laravel-actions` command to get information for Laravel Lang.
Tip: Use the `composer info dragon-code/laravel-deploy-operations` command to get information for Laravel Lang.
Tip: Use the `php artisan --version` command to get information for Laravel Framework.
Tip: Use the `php -v` command to get information for PHP.
value: |
- PHP Version:
- Database Driver & Version:
- Actions Version:
- Deploy Operations Version:
- Laravel Version:
validations:
required: true
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -22,9 +22,9 @@ This package is licensed under the [MIT License](LICENSE).

[badge_build]: https://img.shields.io/github/actions/workflow/status/TheDragonCode/laravel-actions/phpunit.yml?style=flat-square

[badge_downloads]: https://img.shields.io/packagist/dt/dragon-code/laravel-actions.svg?style=flat-square
[badge_downloads]: https://img.shields.io/packagist/dt/dragon-code/laravel-deploy-operations.svg?style=flat-square

[badge_license]: https://img.shields.io/packagist/l/dragon-code/laravel-actions.svg?style=flat-square
[badge_license]: https://img.shields.io/packagist/l/dragon-code/laravel-deploy-operations.svg?style=flat-square

[badge_stable]: https://img.shields.io/github/v/release/TheDragonCode/laravel-actions?label=stable&style=flat-square

@@ -34,4 +34,4 @@ This package is licensed under the [MIT License](LICENSE).

[link_license]: LICENSE

[link_packagist]: https://packagist.org/packages/dragon-code/laravel-actions
[link_packagist]: https://packagist.org/packages/dragon-code/laravel-deploy-operations
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "dragon-code/laravel-actions",
"name": "dragon-code/laravel-deploy-operations",
"description": "Performing any actions during the deployment process",
"license": "MIT",
"type": "library",
@@ -58,6 +58,7 @@
},
"conflict": {
"andrey-helldar/laravel-actions": "*",
"dragon-code/laravel-actions": "*",
"dragon-code/laravel-migration-actions": "*"
},
"suggest": {
@@ -67,7 +68,7 @@
"prefer-stable": true,
"autoload": {
"psr-4": {
"DragonCode\\LaravelActions\\": "src/"
"DragonCode\\LaravelDeployOperations\\": "src/"
}
},
"autoload-dev": {
@@ -88,7 +89,7 @@
"extra": {
"laravel": {
"providers": [
"DragonCode\\LaravelActions\\ServiceProvider"
"DragonCode\\LaravelDeployOperations\\ServiceProvider"
]
}
}
24 changes: 12 additions & 12 deletions config/actions.php → config/deploy-operations.php
Original file line number Diff line number Diff line change
@@ -3,39 +3,39 @@
return [
/*
|--------------------------------------------------------------------------
| Actions Repository Connection
| Operations Repository Connection
|--------------------------------------------------------------------------
|
| This option controls the database connection used to store the table
| of executed actions.
| of executed operations.
|
*/

'connection' => env('DB_CONNECTION'),

/*
|--------------------------------------------------------------------------
| Actions Repository Table
| Operations Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the actions that have already run for
| This table keeps track of all the operations that have already run for
| your application. Using this information, we can determine which of
| the actions on disk haven't actually been run in the database.
| the operations on disk haven't actually been run in the database.
|
*/

'table' => 'actions',
'table' => 'operations',

/*
|--------------------------------------------------------------------------
| Actions Path
| Operations Path
|--------------------------------------------------------------------------
|
| This option defines the path to the action directory.
| This option defines the path to the operation directory.
|
*/

'path' => base_path('actions'),
'path' => base_path('operations'),

/*
|--------------------------------------------------------------------------
@@ -64,7 +64,7 @@
|--------------------------------------------------------------------------
|
| This option specifies the queue settings that will process
| asynchronous actions.
| asynchronous operations.
|
*/

@@ -78,7 +78,7 @@
|
*/

'connection' => env('ACTIONS_QUEUE_CONNECTION', env('QUEUE_CONNECTION', 'sync')),
'connection' => env('DEPLOY_OPERATIONS_QUEUE_CONNECTION', env('QUEUE_CONNECTION', 'sync')),

/*
|--------------------------------------------------------------------------
@@ -90,6 +90,6 @@
|
*/

'name' => env('ACTIONS_QUEUE_NAME'),
'name' => env('DEPLOY_OPERATIONS_QUEUE_NAME'),
],
];
Original file line number Diff line number Diff line change
@@ -2,12 +2,12 @@

declare(strict_types=1);

use DragonCode\LaravelActions\Action;
use DragonCode\LaravelActions\Helpers\Config;
use DragonCode\LaravelDeployOperations\Helpers\Config;
use DragonCode\LaravelDeployOperations\Operation;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Action {
return new class extends Operation {
public function up(): void
{
if ($this->hasTable()) {
Original file line number Diff line number Diff line change
@@ -2,11 +2,11 @@

declare(strict_types=1);

use DragonCode\LaravelActions\Action;
use DragonCode\LaravelActions\Helpers\Config;
use DragonCode\LaravelDeployOperations\Helpers\Config;
use DragonCode\LaravelDeployOperations\Operation;
use Illuminate\Support\Facades\Schema;

return new class extends Action {
return new class extends Operation {
public function up(): void
{
if (Schema::hasTable('migration_actions') && $this->doesntSame('migration_actions', $this->table())) {
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

declare(strict_types=1);

use DragonCode\LaravelDeployOperations\Helpers\Config;
use DragonCode\LaravelDeployOperations\Operation;
use Illuminate\Support\Facades\Schema;

return new class extends Operation {
public function up(): void
{
if (Schema::hasTable('actions') && $this->doesntSame('actions', $this->table())) {
$this->validateTable($this->table());

Schema::rename('actions', $this->table());
}
}

public function down(): void
{
if (Schema::hasTable($this->table()) && $this->doesntSame('actions', $this->table())) {
$this->validateTable('actions');

Schema::rename($this->table(), 'actions');
}
}

protected function validateTable(string $name): void
{
if (Schema::hasTable($name)) {
throw new RuntimeException(sprintf('A table named [%s] already exists. Change the table name settings in the [%s] configuration file.', $name, 'config/deploy-operations.php'));
}
}

protected function doesntSame(string $first, string $second): bool
{
return $first !== $second;
}

protected function table(): string
{
return app(Config::class)->table();
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

declare(strict_types=1);

use DragonCode\LaravelDeployOperations\Helpers\Config;
use DragonCode\LaravelDeployOperations\Operation;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Operation {
public function up(): void
{
$this->rename('action', 'operation');
}

public function down(): void
{
$this->rename('operation', 'action');
}

protected function rename(string $from, string $to): void
{
if (Schema::hasColumn($this->table(), $from)) {
Schema::table($this->table(), fn (Blueprint $table) => $table->renameColumn($from, $to));
}
}

protected function table(): string
{
return app(Config::class)->table();
}
};
19 changes: 10 additions & 9 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -40,14 +40,14 @@ function resolveNumeric(value) {
return isNaN(num) ? value : num
}

const hostname = 'actions.dragon-code.pro'
const hostname = 'deploy-operations.dragon-code.pro'

export default defineUserConfig({
bundler: viteBundler(),

lang: 'en-US',
title: 'Dragon Code: Actions',
description: 'Performing actions with saving the list of called files',
title: 'Dragon Code: Deploy Operations for Laravel',
description: 'Performing deploy operations with saving the list of called files',

head: [
['link', {rel: 'icon', href: `https://${hostname}/images/logo.svg`}],
@@ -60,9 +60,9 @@ export default defineUserConfig({

logo: `https://${hostname}/images/logo.svg`,

repo: 'https://github.com/TheDragonCode/laravel-actions',
repo: 'https://github.com/TheDragonCode/laravel-deploy-operations',
repoLabel: 'GitHub',
docsRepo: 'https://github.com/TheDragonCode/laravel-actions',
docsRepo: 'https://github.com/TheDragonCode/laravel-deploy-operations',
docsBranch: 'main',
docsDir: 'docs',

@@ -71,11 +71,12 @@ export default defineUserConfig({

navbar: [
{
text: '5.x',
text: '6.x',
children: [
{text: '5.x', link: '/getting-started/installation/index.md'},
{text: '4.x', link: 'https://github.com/TheDragonCode/laravel-actions/blob/4.x/docs/index.md'},
{text: '3.x', link: 'https://github.com/TheDragonCode/laravel-actions/blob/3.x/docs/index.md'},
{text: '6.x', link: '/getting-started/installation/index.md'},
{text: '5.x', link: 'https://github.com/TheDragonCode/laravel-deploy-operations/blob/5.x/docs/index.md'},
{text: '4.x', link: 'https://github.com/TheDragonCode/laravel-deploy-operations/blob/4.x/docs/index.md'},
{text: '3.x', link: 'https://github.com/TheDragonCode/laravel-deploy-operations/blob/3.x/docs/index.md'},
]
}
],
8 changes: 4 additions & 4 deletions docs/getting-started/installation/index.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Installation

To get the latest version of `Deploy Actions for Laravel`, simply require the project using [Composer](https://getcomposer.org):
To get the latest version of `Deploy Operations for Laravel`, require the project using [Composer](https://getcomposer.org):

```bash
composer require dragon-code/laravel-actions
composer require dragon-code/laravel-deploy-operations
```

Or manually update `require` block of `composer.json` and run `composer update` console command.

```json
{
"require": {
"dragon-code/laravel-actions": "^5.0"
"dragon-code/laravel-deploy-operations": "^6.0"
}
}
```

If necessary, you can publish the configuration file by calling the console command:

```bash
php artisan vendor:publish --provider="DragonCode\LaravelActions\ServiceProvider"
php artisan vendor:publish --provider="DragonCode\LaravelDeployOperations\ServiceProvider"
```
7 changes: 4 additions & 3 deletions docs/helpers/artisan.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Artisan Command

Quite often, when working with actions, it becomes necessary to run one or another console command, and each time you have to write the following code:
Quite often, when working with operations, it becomes necessary to run one or another console command,
and each time you have to write the following code:

```php
use DragonCode\LaravelActions\Action;
use DragonCode\LaravelDeployOperations\Operation;

return new class () extends Action
return new class extends Operation
{
public function __invoke(): void
{
Loading