Skip to content

Commit 190d3e1

Browse files
authored
Merge pull request #116 from WordPress/reduce-load
remove verbose mode for rsync
2 parents 0659c73 + e62e13c commit 190d3e1

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

.env.default

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,7 @@ export WPT_SSH_OPTIONS=
5555

5656
# SSH private key, base64 encoded.
5757
export WPT_SSH_PRIVATE_KEY_BASE64=
58+
59+
# Output logging
60+
# Use 'verbose' to increase verbosity
61+
export WPT_DEBUG=

prepare.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
$WPT_SSH_CONNECT = getenv( 'WPT_SSH_CONNECT' );
1515
$WPT_SSH_OPTIONS = getenv( 'WPT_SSH_OPTIONS' ) ? : '-o StrictHostKeyChecking=no';
1616
$WPT_TEST_DIR = getenv( 'WPT_TEST_DIR' );
17-
$WPT_PHP_EXECUTABLE = getenv( 'WPT_PHP_EXECUTABLE') ? : 'php';
17+
$WPT_PHP_EXECUTABLE = getenv( 'WPT_PHP_EXECUTABLE' ) ? : 'php';
18+
$WPT_DEBUG = getenv( 'WPT_DEBUG' );
1819

1920
// Set the ssh private key if it's set.
2021
$WPT_SSH_PRIVATE_KEY_BASE64 = getenv( 'WPT_SSH_PRIVATE_KEY_BASE64' );
@@ -105,8 +106,14 @@
105106

106107
// Deliver all files to test environment.
107108
if ( ! empty( $WPT_SSH_CONNECT ) ) {
109+
$rsync_options = '-r';
110+
111+
if ( 'verbose' === $WPT_DEBUG ) {
112+
$rsync_options = $rsync_options . 'v';
113+
}
114+
108115
perform_operations( array(
109-
'rsync -rv --exclude=".git/" -e "ssh ' . $WPT_SSH_OPTIONS . '" ' . escapeshellarg( trailingslashit( $WPT_PREPARE_DIR ) ) . ' ' . escapeshellarg( $WPT_SSH_CONNECT . ':' . $WPT_TEST_DIR ),
116+
'rsync ' . $rsync_options . ' --exclude=".git/" -e "ssh ' . $WPT_SSH_OPTIONS . '" ' . escapeshellarg( trailingslashit( $WPT_PREPARE_DIR ) ) . ' ' . escapeshellarg( $WPT_SSH_CONNECT . ':' . $WPT_TEST_DIR ),
110117
) );
111118
}
112119

report.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
$WPT_PREPARE_DIR = getenv( 'WPT_PREPARE_DIR' );
1515
$WPT_SSH_OPTIONS = getenv( 'WPT_SSH_OPTIONS' );
1616
$WPT_REPORT_API_KEY = getenv( 'WPT_REPORT_API_KEY' );
17+
$WPT_DEBUG = getenv( 'WPT_DEBUG' );
1718

1819
log_message('Getting SVN Revision');
1920
$rev = exec('git --git-dir=' . escapeshellarg( $WPT_PREPARE_DIR ) . '/.git log -1 --pretty=%B | grep "git-svn-id:" | cut -d " " -f 2 | cut -d "@" -f 2');
@@ -28,7 +29,13 @@
2829
$junit_location = '-e "ssh ' . $WPT_SSH_OPTIONS . '" ' . escapeshellarg( $WPT_SSH_CONNECT . ':' . $junit_location );
2930
}
3031

31-
$junit_exec = 'rsync -rv ' . $junit_location . ' ' . escapeshellarg( $WPT_PREPARE_DIR );
32+
$rsync_options = '-r';
33+
34+
if ( 'verbose' === $WPT_DEBUG ) {
35+
$rsync_options = $rsync_options . 'v';
36+
}
37+
38+
$junit_exec = 'rsync ' . $rsync_options . ' ' . $junit_location . ' ' . escapeshellarg( $WPT_PREPARE_DIR );
3239
perform_operations( array(
3340
$junit_exec,
3441
) );

0 commit comments

Comments
 (0)