Skip to content

Commit 4fd8673

Browse files
committed
Improve provision
1 parent 4ecc478 commit 4fd8673

File tree

4 files changed

+24
-30
lines changed

4 files changed

+24
-30
lines changed

docs/recipe/provision.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ As only Ubuntu 20.04 LTS is supported for provision should be the `focal`.
2222

2323

2424
### sudo_password
25-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision.php#L156)
25+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision.php#L157)
2626

2727

2828

2929

3030

3131
### ssh_copy_id
32-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision.php#L162)
32+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision.php#L163)
3333

3434
Specify which key to copy to server.
3535
Set to `false` to disable copy of key.
@@ -84,63 +84,63 @@ Collect required params.
8484

8585

8686
### provision:update
87-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision.php#L79)
87+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision.php#L80)
8888

8989
Add repositories and update.
9090

9191

9292

9393

9494
### provision:upgrade
95-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision.php#L101)
95+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision.php#L102)
9696

9797
Upgrade all packages.
9898

9999

100100

101101

102102
### provision:install
103-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision.php#L108)
103+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision.php#L109)
104104

105105
Install packages.
106106

107107

108108

109109

110110
### provision:server
111-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision.php#L141)
111+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision.php#L142)
112112

113113
Configure server.
114114

115115

116116

117117

118118
### provision:ssh
119-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision.php#L146)
119+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision.php#L147)
120120

121121
Configure SSH.
122122

123123

124124

125125

126126
### provision:deployer
127-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision.php#L165)
127+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision.php#L166)
128128

129129
Setup deployer user.
130130

131131

132132

133133

134134
### provision:firewall
135-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision.php#L212)
135+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision.php#L213)
136136

137137
Setup firewall.
138138

139139

140140

141141

142142
### provision:banner
143-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision.php#L220)
143+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision.php#L221)
144144

145145
Show banner.
146146

docs/recipe/provision/website.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,23 @@
2626
## Tasks
2727

2828
### provision:website
29-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision/website.php#L14)
29+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision/website.php#L13)
3030

3131
Provision website.
3232

3333

3434

3535

3636
### logs:caddy
37-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision/website.php#L70)
37+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision/website.php#L69)
3838

3939
Show caddy logs.
4040

4141

4242

4343

4444
### logs:caddy:syslog
45-
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision/website.php#L75)
45+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/provision/website.php#L74)
4646

4747
Show caddy syslog.
4848

recipe/provision.php

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
$params = [
6060
'sudo_password',
6161
'domain',
62+
'public_path',
6263
'php_version',
6364
'db_user',
6465
'db_name',
@@ -219,18 +220,12 @@
219220
desc('Show banner');
220221
task('provision:banner', function () {
221222
output()->write(<<<EOF
222-
╭──────────────────────────────────────────────────╮
223-
│ │
224-
│ Hello, my name is Anton Medvedev. │
225-
│ I'm the creator of the Deployer. I maintain │
226-
│ this open source project in my spare time. │
227-
│ Supporters on GitHub gives me an extra │
228-
│ motivation to work on the project. │
229-
│ │
230-
│ Consider supporting Deployer: │
231-
│ │
232-
│ https://github.com/sponsors/antonmedv │
233-
│ │
234-
╰──────────────────────────────────────────────────╯
223+
╭──────────────────────────────────────╮
224+
│ │
225+
│ Supporting Deployer Development │
226+
│ │
227+
│ https://ï.at/support-deployer │
228+
│ │
229+
╰──────────────────────────────────────╯
235230
EOF);
236231
})->once();

recipe/provision/website.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
});
77

88
set('public_path', function () {
9-
$path = run("realpath {{deploy_path}}");
10-
return "$path/current/public";
9+
return ask(' Public path: ', 'public');
1110
});
1211

1312
desc('Provision website');
@@ -18,7 +17,7 @@
1817

1918
$domain = get('domain');
2019
$phpVersion = get('php_version');
21-
$deployPath = get('deploy_path');
20+
$deployPath = run("realpath {{deploy_path}}");
2221
$publicPath = get('public_path');
2322

2423
cd($deployPath);
@@ -29,7 +28,7 @@
2928
$caddyfile = <<<EOF
3029
$domain
3130
32-
root * $publicPath
31+
root * $deployPath/current/$publicPath
3332
file_server
3433
php_fastcgi * unix/run/php/php$phpVersion-fpm.sock {
3534
\tresolve_root_symlink

0 commit comments

Comments
 (0)