Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Performance Tests on CI #24925

Merged
merged 1 commit into from
Aug 31, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions bin/plugin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@
*/
const program = require( 'commander' );

const catchException = ( command ) => {
return async ( ...args ) => {
try {
await command( ...args );
} catch ( error ) {
console.error( error );
process.exitCode = 1;
}
};
};

/**
* Internal dependencies
*/
Expand All @@ -22,37 +33,37 @@ program
.description(
'Release an RC version of the plugin (supports only rc.1 for now)'
)
.action( releaseRC );
.action( catchException( releaseRC ) );

program
.command( 'release-plugin-stable' )
.alias( 'stable' )
.description( 'Release a stable version of the plugin' )
.action( releaseStable );
.action( catchException( releaseStable ) );

program
.command( 'prepare-packages-stable' )
.alias( 'npm-stable' )
.description(
'Prepares the packages to be published to npm as stable (latest dist-tag, production version)'
)
.action( prepareLatestDistTag );
.action( catchException( prepareLatestDistTag ) );

program
.command( 'prepare-packages-rc' )
.alias( 'npm-rc' )
.description(
'Prepares the packages to be published to npm as RC (next dist-tag, RC version)'
)
.action( prepareNextDistTag );
.action( catchException( prepareNextDistTag ) );

program
.command( 'release-plugin-changelog' )
.alias( 'changelog' )
.option( '-m, --milestone <milestone>', 'Milestone' )
.option( '-t, --token <token>', 'Github token' )
.description( 'Generates a changelog from merged Pull Requests' )
.action( getReleaseChangelog );
.action( catchException( getReleaseChangelog ) );

program
.command( 'performance-tests [branches...]' )
Expand All @@ -65,6 +76,6 @@ program
.description(
'Runs performance tests on two separate branches and outputs the result'
)
.action( runPerformanceTests );
.action( catchException( runPerformanceTests ) );

program.parse( process.argv );