twilio / twilio-cli

Unleash the power of Twilio from your command prompt
MIT License
162 stars 79 forks source link

`flex:plugins:deploy` doesn't return non-zero exit code when the deployment failed due to the lower provided version #563

Closed marek-siemieniuk-morawski closed 8 months ago

marek-siemieniuk-morawski commented 10 months ago

Issue Summary

I'm building a deployment pipeline for our Twilio CRM plugin and I noticed that the Bitbucket Pipeline doesn't fail when the deployment fails due to lower the provided version regarding the deployed one.

Here are the logs:

+ npm run deploy

> plugin-my-project@0.30.2 deploy
> twilio flex:plugins:deploy --version "$npm_package_version" --changelog "MYCHANGELOG"

Using profile ${TWILIOAPIKEY}/${TWILIOAPISECRET} (ACCOUNTSID)

- Validating deployment of plugin plugin-my-project
✖ The provided version 0.30.2 must be greater than 0.30.2
The provided version 0.30.2 must be greater than 0.30.2

The output clearly says that the deployment failed, but, unfortunately, Bitbucket Pipelines didn't acknowledge it and marked the build as successful.

I performed a simple test, I ran flex:plugins:deploy with the following boolean operator

twilio flex:plugins:deploy --version 1.0.0 --changelog "Some changes" || echo "It should be printed only if the command failed"

which proves that in this particular case the command returns 0 exit code as the echo is not executed.

Steps to Reproduce

  1. Deploy a given version of a plugin to Twilio
  2. Deploy the same version once again

Technical details:

❯ twilio --version
node twilio-cli/5.16.2 darwin-x64 node-v18.18.2

❯ node --version
v18.16.0
github-actions[bot] commented 9 months ago

This issue is stale because it has been open for 30 days with no activity. Please remove stale label or comment or this issue will be closed in 30 days.

github-actions[bot] commented 8 months ago

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.