Can we undeploy API proxy using Maven plugin?

Not applicable

Hi All,

I was curious if we have sth to undeploy API proxy in maven plugin. I couldn't find one.

I know an alternative to use apigeetool (node based) but that does not seem a good option for me.

My use case is sth like (using jenkins)

Step 1) Deploy the API proxy to dev env on SVN commit (Done this using maven plugin).

Step 2) After successful deployment run soapui test cases.

Step 3) If the test cases pass then push it to test env. else

undeploy this revision and deploy the last revision

Please suggest how we can do this??

0 7 971
7 REPLIES 7

Not applicable

Hi @Vipul Agarwal, please review the Command section of the Maven plug-in's README file. It provides the ability for you to specify apigee.options with values of clean, validate, inactive, override, and update. You can use these apigee.options for your use case. You can use the override or update option depending on whether you want to increment the revision number upon deployment.

But how to rollback in case of test case failure?

You would need to write a script to validate whether the tests have succeeded. If they didn't you would need to run the clean command.

Hi @Berend van Waalwijk,

I have worked on using clean command but it is removing the deployed revision from the proxy. It would be good if you can share the script to un-deploy the revision and to redeploy to the previous ones.

Regards,

Ashwith

Thats not supported by the plugin. The plugin is meant to package and deploy the code that is in your source code. There are two options here

1) Write a script that calls the Management API to deploy a revision that is already pushed to Apigee

or

2) Package the code from source code with that commit id / branch / tag that was stable

After deleting the revision you need to deploy the last stable/successful version. You could also just deploy the latest stable version in stead of deleting the broken one.

I do not have such a script as of now so I can't share it with you I'm afraid.

Hi Vipul, Were you able to solve the issue? If yes, please let me know the approach you followed.