Skip to content

Commit 86d097a

Browse files
authored
Define default options, add hint for auto-generated file (#5)
1 parent e1afc87 commit 86d097a

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

res/deploy.tpl.php

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
11
<?php
22
/**
33
* Deployer configuration.
4+
*
5+
* THIS FILE IS AUTO-GENERATED. DO NOT EDIT THIS FILE.
6+
* Source: https://github.com/wearerequired/composer-deployer
47
*/
58

69
namespace Deployer;
710

811
require 'recipe/common.php';
912

10-
inventory( 'deploy.yml' );
11-
13+
// Default options.
14+
set( 'allow_anonymous_stats', false );
1215
set( 'default_stage', 'staging' );
16+
set(
17+
'composer_options',
18+
function () {
19+
$production = 'production' === get( 'stage' );
20+
return sprintf(
21+
'{{composer_action}} --verbose --prefer-dist --no-progress --no-interaction %s --optimize-autoloader --no-suggest',
22+
$production ? '--no-dev' : ''
23+
);
24+
}
25+
);
26+
27+
// Load options and hosts from inventory.
28+
inventory( 'deploy.yml' );
1329

1430
// Tasks.
31+
desc( 'Install WordPress translations' );
1532
task(
1633
'wp:install_translations',
1734
function () {
@@ -27,6 +44,7 @@ function () {
2744
}
2845
);
2946

47+
desc( 'Update WordPress translations' );
3048
task(
3149
'wp:update_translations',
3250
function () {
@@ -41,6 +59,10 @@ function () {
4159
}
4260
);
4361

62+
desc( 'Install and update WordPress translations' );
63+
task( 'wp:translations', [ 'wp:install_translations', 'wp:update_translations' ] );
64+
65+
desc( 'Clear OPcache' );
4466
task(
4567
'wp:opcache_clear',
4668
function () {
@@ -56,8 +78,6 @@ function () {
5678
}
5779
);
5880

59-
task( 'wp:translations', [ 'wp:install_translations', 'wp:update_translations' ] );
60-
6181
desc( 'Deploy your project' );
6282
task(
6383
'deploy',

0 commit comments

Comments
 (0)