2

Deployments from IDEA are possible, e.g. I can connect to remote server and I can upload a package. The deployment process I have involves a little bit more than just deploying a file on server.

Once the file is uploaded I need to run certain commands to complete the deployment which mean I need to connect to the server and run those commands one by one and I am looking to do that through one click from the IntelliJ IDEA.

Is that possible?

This is how the project directory looks like: enter image description here

This is how I am trying to setup deployment:

enter image description here

if you click on that little "Fix" button that's what I see enter image description here

Even if I try to remove the unwanted entries they come back and never go away. Finally this is what my project structure looks like in idea enter image description here

Toseef Zafar
  • 1,601
  • 4
  • 28
  • 46

1 Answers1

1

Yes, you can use Remote SSH External tools. Make a script that will run your commands, deploy it to the server as well, then run this script remotely via a tool.

In the Run/Debug configuration Before Launch steps you can add your remote external tool to run automatically.

You can find some more details in my another answer.

Community
  • 1
  • 1
CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • Thanks CrazyCoder! I will give it a go :) – Toseef Zafar Feb 22 '17 at 17:50
  • Hi, I tried setting up the SFTP connection using the Deployment option in idea. The problem I got now is I want to upload just one file which is .war package, but idea seems to detect some unmapped paths which I cant seem to be able to remove without removing them I am not able to run the upload job. – Toseef Zafar Feb 23 '17 at 13:14
  • Configure artifact to produce only the war file into the directory that you will sync, this way any other files will not upload and you can create only one mapping for this specific directory. – CrazyCoder Feb 23 '17 at 13:16
  • basically i have a got a project at based .../hkc/ under this hkc/ I have got different maven modules. What deployment is doing is its asking me to provide a remote path for every module so e.g. if I have hkc/a , hkc/b, and hkc/c which are completely separate modules its asking me to provide remote path for each directory and I can remove these entries, I have also tried excluded paths but no success. All I want it to is to pick up hkc/a/target/a.war and put it on server. – Toseef Zafar Feb 23 '17 at 15:02
  • still the same, the deployment configuration is showing all the modules and requires me to put the deployment path for all a, b, and c modules! – Toseef Zafar Feb 23 '17 at 15:33
  • Add screenshots/sample project so that we can understand the problem. – CrazyCoder Feb 23 '17 at 15:33
  • Try specifying a directory with the `.war` as the *Local path* instead of the file itself. – CrazyCoder Feb 23 '17 at 17:19
  • Do you mean that deployment doesn't work with unmapped roots? – CrazyCoder Feb 23 '17 at 17:23
  • yes, the deployment doesn't work until I provide the remote paths against each of those modules. – Toseef Zafar Feb 24 '17 at 00:06