File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 $deploy = new Exolnet\Envoy\ConfigDeploy(get_defined_vars());
55 $environment = $deploy->getEnvironment();
66 extract($environment->extractVariables());
7+
8+ $dotenvVars = array_filter(explode(PHP_EOL, $dotenvVars ?? ''));
79@endsetup
810
911@servers ([' web' => $serverString ] )
4951 deploy:git
5052 deploy:link
5153 deploy:copy
54+ deploy:dotenv
5255 deploy:composer
5356 deploy:npm
5457 deploy:provisioned
8083 deploy:git
8184 deploy:link
8285 deploy:copy
86+ deploy:dotenv
8387 deploy:composer
8488 deploy:npm
8589 deploy:provisioned
254258 @endforeach
255259@endtask
256260
261+ @task (' deploy:dotenv' )
262+ cd "{{ $releasePath } } "
263+
264+ @foreach ($dotenvVars as $dotenvVar )
265+ @php
266+ [$dotenvVarName , $dotenvVarValue ] = explode (' =' , $dotenvVar , 2 );
267+
268+ $dotenvVarName = trim (escapeshellarg (trim ($dotenvVarName )), ' \' ' );
269+ $dotenvVarValue = trim (escapeshellarg (trim ($dotenvVarValue )), ' \' ' );
270+ @endphp
271+
272+ sed -i -E "s/^(#\\s*)?{{ $dotenvVarName } } =.*/{{ $dotenvVarName } } ={{ $dotenvVarValue } } /" .env
273+ @endforeach
274+ @endtask
275+
257276@task (' deploy:composer' )
258277 @foreach (array_unique ([$releasePath , $assetsPath ]) as $path )
259278 cd "{{ $path } } "
You can’t perform that action at this time.
0 commit comments