Skip to content

Commit e6dd09a

Browse files
Merge pull request #168 from TheDragonCode/6.x
Update documentation
2 parents 9295a2d + ab1b0e1 commit e6dd09a

File tree

20 files changed

+269
-167
lines changed

20 files changed

+269
-167
lines changed

README.md

+47-12
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,60 @@
1-
# Deploy Operations for Laravel
1+
# 🚀 Laravel Deploy Operations
22

3-
![the dragon code operations](https://preview.dragon-code.pro/the-dragon-code/deploy-operations.svg?brand=laravel&mode=dark)
3+
![the dragon code laravel deploy operations](https://preview.dragon-code.pro/the-dragon-code/deploy-operations.svg?brand=laravel&mode=dark)
44

55
[![Stable Version][badge_stable]][link_packagist]
66
[![Total Downloads][badge_downloads]][link_packagist]
77
[![Github Workflow Status][badge_build]][link_build]
88
[![License][badge_license]][link_license]
99

10-
> Operations are like version control for your operation process,
11-
> allowing your team to modify and share the application's operational schema.
12-
> If you have ever had to tell a teammate to manually perform any operation on a production server,
13-
> you've come across an issue that operation solves.
10+
**Performing any actions during the deployment process**
11+
12+
Create specific classes for a one-time or more-time usage, that can be executed automatically after each deployment.
13+
Perfect for seeding or updating some data instantly after some database changes, feature updates, or perform any
14+
actions.
15+
16+
This package is for you if...
17+
18+
- you regularly need to update specific data after you deploy new code
19+
- you often perform jobs after deployment
20+
- you sometimes forget to execute that one specific job and stuff gets crazy
21+
- your code gets cluttered with jobs that are not being used anymore
22+
- your co-workers always need to be reminded to execute that one job after some database changes
23+
- you often seed or process data in a migration file (which is a big no-no!)
24+
25+
## Installation
26+
27+
```Bash
28+
composer require dragon-code/laravel-deploy-operations
29+
```
1430

1531
## Documentation
1632

17-
See the [documentation](https://deploy-operations.dragon-code.pro) for detailed installation and usage instructions.
33+
📚 Read the full documentation at [deploy-operations.dragon-code.pro][link_website].
1834

19-
## Upgrade Guide
35+
## Basic Usage
2036

21-
To upgrade from `Laravel Deploy Actions` versions 4 and 5 to `Deploy Operations`, read these guides:
37+
Create your first operation using `php artisan make:operation` console command and define the actions it should
38+
perform.
2239

23-
- [To 6.x from 5.x](https://deploy-operations.dragon-code.pro/prologue/upgrade-guide/6.x.html)
24-
- [To 5.x from 4.x](https://deploy-operations.dragon-code.pro/prologue/upgrade-guide/5.x.html)
40+
```php
41+
use DragonCode\LaravelDeployOperations\Operation;
42+
43+
return new class extends Operation {
44+
public function __invoke(): void
45+
{
46+
// any actions
47+
}
48+
};
49+
```
50+
51+
Next, you can run the console command to start operations:
52+
53+
```Bash
54+
php artisan operations
55+
```
56+
57+
📚 [Check out the full documentation to learn everything that Laravel Deploy Operations has to offer.][link_website]
2558

2659
## License
2760

@@ -34,10 +67,12 @@ This package is licensed under the [MIT License](LICENSE).
3467

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

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

3972
[link_build]: https://github.com/TheDragonCode/laravel-actions/actions
4073

4174
[link_license]: LICENSE
4275

4376
[link_packagist]: https://packagist.org/packages/dragon-code/laravel-deploy-operations
77+
78+
[link_website]: https://deploy-operations.dragon-code.pro

docs/.vuepress/config.js

+36-45
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@ function getChildren(folder, sort = 'asc') {
1616

1717
return fs
1818
.readdirSync(path.join(dir))
19-
.filter(item =>
20-
fs.statSync(path.join(dir, item)).isFile() &&
21-
!names.includes(item.toLowerCase()) &&
22-
extension.includes(path.extname(item))
23-
)
19+
.filter(item => fs.statSync(path.join(dir, item)).isFile() && !names.includes(item.toLowerCase()) && extension.includes(path.extname(item)))
2420
.sort((a, b) => {
2521
a = resolveNumeric(a)
2622
b = resolveNumeric(b)
@@ -46,13 +42,10 @@ export default defineUserConfig({
4642
bundler: viteBundler(),
4743

4844
lang: 'en-US',
49-
title: 'Deploy Operations for Laravel',
50-
description: 'Run operations after deployment - just like you do it with migrations!',
45+
title: 'Laravel Deploy Operations',
46+
description: 'Performing any actions during the deployment process',
5147

52-
head: [
53-
['link', {rel: 'icon', href: `https://${hostname}/images/logo.svg`}],
54-
['meta', {name: 'twitter:image', content: `https://${hostname}/images/logo.svg`}]
55-
],
48+
head: [['link', {rel: 'icon', href: `https://${hostname}/images/logo.svg`}]],
5649

5750
theme: defaultTheme({
5851
hostname,
@@ -72,56 +65,54 @@ export default defineUserConfig({
7265
navbar: [
7366
{
7467
text: '6.x',
75-
children: [
76-
{text: '6.x', link: '/getting-started/installation/index.md'},
77-
{text: '5.x', link: 'https://github.com/TheDragonCode/laravel-deploy-operations/blob/5.x/docs/index.md'},
78-
{text: '4.x', link: 'https://github.com/TheDragonCode/laravel-deploy-operations/blob/4.x/docs/index.md'},
79-
{text: '3.x', link: 'https://github.com/TheDragonCode/laravel-deploy-operations/blob/3.x/docs/index.md'},
80-
]
81-
}
82-
],
83-
84-
sidebarDepth: 1,
85-
86-
sidebar: [
87-
{
88-
text: 'Prologue',
8968
children: [
9069
{
91-
text: 'Upgrade Guide',
92-
link: '/prologue/upgrade-guide/index.md'
70+
text: '6.x',
71+
link: '/getting-started/installation.md'
9372
},
9473
{
95-
text: 'License',
96-
link: '/prologue/license.md'
97-
}
74+
text: '5.x',
75+
link: 'https://github.com/TheDragonCode/laravel-deploy-operations/blob/5.x/docs/index.md'
76+
}, {
77+
text: '4.x',
78+
link: 'https://github.com/TheDragonCode/laravel-deploy-operations/blob/4.x/docs/index.md'
79+
}, {
80+
text: '3.x',
81+
link: 'https://github.com/TheDragonCode/laravel-deploy-operations/blob/3.x/docs/index.md'
82+
},
9883
]
99-
},
84+
}],
10085

86+
sidebarDepth: 1,
87+
88+
sidebar: [
10189
{
102-
text: 'Getting Started',
103-
children: [
104-
{
105-
text: 'Installation',
106-
link: '/getting-started/installation/index.md'
107-
}
90+
text: 'Getting Started', children: [
91+
'/index.md',
92+
'/getting-started/installation.md',
93+
'/guide/basic.md',
94+
'/upgrade-guide/index.md'
10895
]
10996
},
110-
11197
{
112-
text: 'How To Use',
98+
text: 'Guide',
11399
children: [
114-
'/how-to-use/running.md',
115-
'/how-to-use/creating.md',
116-
'/how-to-use/status.md',
117-
'/how-to-use/rollback.md',
118-
'/how-to-use/customize-stub.md',
100+
'/guide/running.md',
101+
'/guide/creating.md',
102+
'/guide/status.md',
103+
'/guide/rollback.md',
104+
'/guide/customize-stub.md',
119105
]
120106
},
121-
122107
{
123108
text: 'Helpers',
124109
children: getChildren('helpers')
110+
},
111+
{
112+
text: 'Extras',
113+
children: [
114+
'/extras/database-data-dumper.md'
115+
]
125116
}
126117
]
127118
})
File renamed without changes.

docs/getting-started/installation.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Installation
2+
3+
## Install the package
4+
5+
All you need to do to get started is add `Deploy Operations` to your [composer](https://getcomposer.org) dependencies:
6+
7+
```bash
8+
composer require dragon-code/laravel-deploy-operations
9+
```
10+
11+
If necessary, you can publish the configuration file by calling the console command:
12+
В случае необходимости
13+
14+
```bash
15+
php artisan vendor:publish --tag=config --provider="DragonCode\LaravelDeployOperations\ServiceProvider"
16+
```
17+
18+
## Publish the operation stub (optional)
19+
20+
You may publish the stub used by the `make:operation` command and/or [Laravel Idea](https://laravel-idea.com)
21+
plugin for [JetBrains PhpStorm](https://www.jetbrains.com/phpstorm/) if you want to modify it.
22+
23+
```bash
24+
php artisan vendor:publish --tag=stubs --provider="DragonCode\LaravelDeployOperations\ServiceProvider"
25+
```
26+
27+
As a result, the file `stubs/deploy-operation.stub` will be created in the root of the project,
28+
which you can change for yourself.

docs/getting-started/installation/index.md

-23
This file was deleted.

docs/guide/basic.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Basic Usage
2+
3+
Create your first operation using `make:operation` command and define the actions it should perform.
4+
5+
```bash
6+
php artisan make:operation
7+
```
8+
9+
```php
10+
use DragonCode\LaravelDeployOperations\Operation;
11+
12+
return new class extends Operation {
13+
public function __invoke(): void
14+
{
15+
// any actions
16+
}
17+
};
18+
```
19+
20+
Next, To run operations, execute the `operations` artisan command:
21+
22+
```bash
23+
php artisan operations
24+
```
25+
26+
The order in which operations are called is checked by file name in alphabetical order,
27+
without taking into account directory names:
28+
29+
```bash
30+
# actual file names
31+
2022_10_14_000001_test1 # 1
32+
2022_10_14_000004_test4 # 4
33+
bar/2022_10_14_000003_test3 # 3
34+
foo/2022_10_14_000002_test2 # 2
35+
```
36+
37+
```bash
38+
# order of running operations at startup
39+
2022_10_14_000001_test1 # 1
40+
foo/2022_10_14_000002_test2 # 2
41+
bar/2022_10_14_000003_test3 # 3
42+
2022_10_14_000004_test4 # 4
43+
```
44+
45+
In addition to other options described in the "Guide" section, you can divide the execution of operations into
46+
"before" and "after" certain actions.
47+
For example, before and after restarting the queues:
48+
49+
```bash
50+
php artisan operations --before
51+
php artisn queue:restart
52+
php artisan operations
53+
```
File renamed without changes.

docs/guide/customize-stub.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Customize Stub
2+
3+
You may publish the stub used by the `make:operation` command and/or [Laravel Idea](https://laravel-idea.com)
4+
plugin for [JetBrains PhpStorm](https://www.jetbrains.com/phpstorm/) if you want to modify it.
5+
6+
```bash
7+
php artisan vendor:publish --tag=stubs --provider="DragonCode\LaravelDeployOperations\ServiceProvider"
8+
```
9+
10+
As a result, the file `stubs/deploy-operation.stub` will be created in the root of the project,
11+
which you can change for yourself.
File renamed without changes.

0 commit comments

Comments
 (0)