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
Please sign in to leave a comment.
This line should help you: RunManager.getInstance(e.getProject()).getSelectedConfiguration()
Thank you! It's done