Skip to content

Commit 77c69c3

Browse files
committed
Fix deploy:env task
1 parent 549e865 commit 77c69c3

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

recipe/deploy/env.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
namespace Deployer;
44

5+
set('dotenv_example', '.env.example');
6+
57
desc('Configure .env file');
68
task('deploy:env', function () {
7-
cd('{{release_path}}');
8-
if (test('[ -f .env.example ]')) {
9-
run('cp .env.example .env');
9+
cd('{{release_or_current_path}}');
10+
if (test('[ ! -f .env ] && [ -f {{dotenv_example}} ]')) {
11+
run('cp {{dotenv_example}} .env');
1012
set('new_deployment', true);
1113
}
1214
});

recipe/spiral.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@
1515
// Path to the RoadRunner server
1616
set('roadrunner_path', '{{release_or_current_path}}');
1717

18-
desc('Create .env file if it doesn\'t exist');
19-
task('deploy:environment', function (): void {
20-
run('cd {{release_or_current_path}} && [ ! -f .env ] && cp .env.sample .env');
21-
});
18+
set('dotenv_example', '.env.sample');
2219

2320
/**
2421
* Run a console command.
@@ -148,7 +145,6 @@ function rr(string $command, array $options = []): \Closure
148145
desc('Deploys your project');
149146
task('deploy', [
150147
'deploy:prepare',
151-
'deploy:environment',
152148
'deploy:vendors',
153149
'spiral:encrypt-key',
154150
'spiral:configure',

recipe/symfony.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
});
6565

6666
desc('Optimize environment variables');
67-
task('deploy:env', function () {
67+
task('deploy:dump-env', function () {
6868
within('{{release_or_current_path}}', function () {
6969
run('{{bin/composer}} dump-env "${APP_ENV:-prod}"');
7070
});

0 commit comments

Comments
 (0)