How to add a deployment button to ToolbarRunGroup?

I'm trying to add a deployment action for my custom remote server.

This is how the button look:

plugin.xml

My action class:

public class Deployment extends AnAction {

public Deployment(){
super("Deployment","Item description", AllIcons.Nodes.Deploy);
}

@Override
public void actionPerformed(AnActionEvent e) {


String host = "chi-ml-930";
String app = "soda"; //I can get it from Run Configuration Name

Runtime runtime = Runtime.getRuntime();
try {
runtime.exec(String.format("cmd /c start V:\\java\\com\\apropos\\%s\\buildAndReplaceViewServerFast.bat %s",app,host));

} catch(IOException ioException) {
System.out.println(ioException.getMessage() );
}
}


}

 

So, the idea is getting host and app from Configuration Run selected to execute a .bat file to do the deployment on my server. 

How can access to data of selected configuration run from an action?

Thank you,

Marcos

0
2 comments
Avatar
Permanently deleted user

This line should help you: RunManager.getInstance(e.getProject()).getSelectedConfiguration()

0
Avatar
Permanently deleted user

Thank you! It's done

0

Please sign in to leave a comment.