Skip to content

Commit acdaa53

Browse files
authored
Create README.md
1 parent 462be2f commit acdaa53

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Laravel Post Deploy Commands
2+
### TL;DR: Create commands that will be run once so that you don't have to remember about it.
3+
4+
This small package is designed to help you make easy changes in your production environment. In short: it is a slightly modified Laravel Migrator in order to run single commands files. Perhaps you are wondering for what purpose?
5+
6+
![](https://i.imgur.com/Br00TCn.gif)
7+
8+
Probably during the maintenance of an application written in Laravel, you encountered the need to make changes in your production environment. For example, copying files to a separate directory or adding new data to the database. How did you do it so far?
9+
10+
You probably used one of the two methods:
11+
12+
- You or one of the teams created a command which then had to be executed on the server. However this raises one serious problem. You must remember to run them. It's easy if deploy is about to take place soon and there are few commands. But as you probably already know it is easy to forget about it when there are many commands to run and deploy will take place in some distant time.
13+
- You have made changes in migration files. However this also raises problems. The code responsible for changes in the database is mixed with the code responsible for other changes. In addition it should be remembered that these changes will be started every time the database is refreshed which increase migration and development time.
14+
15+
The solution I created allows you to easily create commands that will run only once and exactly where you need them. You can easly integrate thmen to your Continuous Delivery process and forget about running changes yourself.
16+
17+
## Usage
18+
Create new command file. The file will be saved in database/commands directory.
19+
```
20+
php artisan make:deploy-command your_command_name
21+
```
22+
Run new commands (Those which have not been started before).
23+
```
24+
php artisan deploy-commands:run
25+
```
26+
27+
## TODO
28+
- clean code
29+
- write some tests
30+
31+
> **NOTE**: The code used to create this package was based on the Laravel code. That is why all the contributions for its creation belong to the creators of Laravel. It was only modified for the purpose of this package.

0 commit comments

Comments
 (0)