Skip to content

Commit 0480536

Browse files
authored
Refactor (#8)
1 parent fc52548 commit 0480536

16 files changed

+234
-326
lines changed

.github/workflows/run-tests.yaml

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
name: Run Tests
22

3-
on: [push, pull_request, workflow_dispatch]
3+
on: ['push', 'pull_request']
44

55
jobs:
66
test:
7-
runs-on: ubuntu-latest
7+
runs-on: ${{ matrix.os }}
88
strategy:
9-
fail-fast: false
9+
fail-fast: true
1010
matrix:
11-
php: [8.2, 8.1]
12-
laravel: [10.*]
13-
stability: [prefer-stable]
11+
os: [ubuntu-latest]
12+
php: [8.3, 8.2]
13+
laravel: [11.*]
14+
stability: [prefer-lowest, prefer-stable]
1415
include:
15-
- laravel: 10.*
16-
testbench: 8.*
16+
- laravel: 11.*
17+
testbench: 9.*
1718

1819
name: PHP ${{ matrix.php }} – Laravel ${{ matrix.laravel }} - ${{ matrix.stability }}
1920

2021
steps:
2122
- name: Checkout code
22-
uses: actions/checkout@v2
23+
uses: actions/checkout@v4
2324

2425
- name: Setup PHP
2526
uses: shivammathur/setup-php@v2

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
vendor
2+
composer.lock
23
.DS_Store
34
.phpunit.result.cache
45
.php-cs-fixer.cache

README.md

+15-14
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Laravel Sync
44
This package provides a git-like artisan command to easily sync files and folders between environments. This is super useful for assets, documents, and any other files that are untracked in your git repository.
55

6-
Laravel Sync is a no-brainer and will soon become best friends with your deploy script. The days are over when you had to manually keep track of files and folders between your environments. Do yourself a favor and give it a try!
6+
Laravel Sync is a no-brainer and the perfect companion for your deploy script. The days are over when you had to manually keep track of files and folders between your environments. Do yourself a favor and give it a try!
77

88
## Requirements
99
- `rsync` on both your source and destination machine
@@ -78,11 +78,7 @@ return [
7878
*/
7979

8080
'options' => [
81-
// '--archive',
82-
// '--itemize-changes',
83-
// '--verbose',
84-
// '--human-readable',
85-
// '--progress'
81+
'--archive',
8682
],
8783

8884
];
@@ -92,15 +88,15 @@ return [
9288
To use this package, you have to define at least one remote and recipe.
9389

9490
### Remotes
95-
Each remote consists of a a `user`, a `host` and a `root`. Optionally, you may also define the SSH `port` and define if the remote should be `read_only`.
91+
Each remote consists of a `user`, `host`, and `root`. Optionally, you may also define the SSH `port` and make a remote `read_only`.
9692

9793
| Key | Description |
9894
| ----------- | ---------------------------------------------- |
9995
| `user` | The username to log in to the host |
10096
| `host` | The IP address of your server. |
10197
| `port` | The SSH port to use for this connection |
10298
| `root` | The absolute path to the project's root folder |
103-
| `read_only` | Set to `true` to make the remote read only |
99+
| `read_only` | Set to `true` to make the remote read-only |
104100

105101
```php
106102
'remotes' => [
@@ -134,7 +130,6 @@ Configure the default rsync options to use when performing a sync. You can overr
134130
```php
135131
'options' => [
136132
'--archive',
137-
'--progress'
138133
],
139134
```
140135

@@ -168,10 +163,11 @@ You have three commands at your disposal:
168163
### Available Options
169164
You may use the following options:
170165

171-
| Option | Description |
172-
| --------------------- | ---------------------------------- |
173-
| `-O*` or `--option=*` | Override the default rsync options |
174-
| `-D` or `--dry` | Perform a dry run of the sync |
166+
| Option | Description |
167+
| --------------------- | --------------------------------------------------------- |
168+
| `-O*` or `--option=*` | Override the default rsync options |
169+
| `-D` or `--dry` | Perform a dry run of the sync with real-time output |
170+
| `-v` or `--verbose` | Displays the real-time output of the sync in the terminal |
175171

176172
## Usage Examples
177173

@@ -185,11 +181,16 @@ Push the assets recipe to the production remote with some custom rsync options:
185181
php artisan sync push production assets --option=-avh --option=--delete
186182
```
187183

188-
Perform a dry sync:
184+
Perform a dry run:
189185
```bash
190186
php artisan sync pull staging assets --dry
191187
```
192188

189+
Echo the real-time output of the sync in your terminal:
190+
```bash
191+
php artisan sync pull staging assets --verbose
192+
```
193+
193194
List the origin, target, options, and port in a nice table:
194195
```bash
195196
php artisan sync:list pull staging assets

composer.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
}
1313
],
1414
"require": {
15-
"php": "^8.1",
16-
"illuminate/support": "^10.0",
17-
"titasgailius/terminal": "^1.2"
15+
"php": "^8.2",
16+
"illuminate/support": "^11.0",
17+
"laravel/prompts": "^0.1.17"
1818
},
1919
"require-dev": {
20-
"nunomaduro/collision": "^7.0",
21-
"orchestra/testbench": "^8.0",
20+
"nunomaduro/collision": "^8.1",
21+
"orchestra/testbench": "^9.0",
2222
"phpunit/phpunit": "^10.0"
2323
},
2424
"autoload": {

config/sync.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@
5151
*/
5252

5353
'options' => [
54-
// '--archive',
55-
// '--itemize-changes',
56-
// '--verbose',
57-
// '--human-readable',
58-
// '--progress'
54+
'--archive',
5955
],
6056

6157
];

src/CommandGenerator.php

-101
This file was deleted.

0 commit comments

Comments
 (0)