Difference between revisions of "Webstorm deploy"

From mn/ifi/inf5750
Jump to: navigation, search
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<p>You can set up Webstorm to deploy your local files to the external group server easily. This is good to do during development.&#160;
+
<div>You can set up webstorm to deploy your local project files using SFTP (SSH) to the group server. This is a simple way to update your server so that you can test the files. Other IDEs support similar deployment functions, but Webstorm only is covered here.&nbsp;</div><div><br/></div><div>First install an app using the standard web dhis interface. You files will be available in a folder like this:</div><div><br/></div><div>/usr/share/tomcat/webapps/ROOT/apps/app-name</div><div><br/></div><div>which will be the following address on your server:</div><div><br/></div><div>[http://servername/apps/app-name http://servername/apps/app-name]</div><div><br/></div><div>Go to Tools->Deployment->Configuration in the menu.&nbsp;</div><div><br/></div><div>A window will appear, and click + to add a new service.<br/></div><div>[[File:Webstorm configuration upload 1.png]]<br/></div><div>&nbsp;</div><div><br/></div><div>Then enter your server name, '/' as the root path and your UIO username and password (the same as you use to SSH into the server).&nbsp;</div><div><br/></div><div>Then under mappings, add a mapping directory.&nbsp;</div><div><br/></div><div>The local path should be on your local hard-disk, where your project is.&nbsp;</div><div><br/></div><div>For me this is: C:\Users\roland\WebstormProjects\Example\app</div><div><br/></div><div>The deployment path is the path on the server where Webstorm will copy the files from your local directory. It should look something like this:</div><div><br/></div><div>/usr/share/tomcat/webapps/ROOT/apps/app-name</div><div><br/></div><div>but instead of app-name, use your app-name&nbsp;</div><div><br/></div><div><span style="font-size: 12px;">TIP: Set up separate app names for each group member, so you can use the same server but have parallell apps.&nbsp;</span></div><div><br/></div><div>The web path would be something like this: /apps/app-name</div><div><br/></div><div><br/></div><div>[[File:Webstorm configuration upload 2.png]]<br/></div><div><br/></div><div><br/></div><div>Under 'Excluded paths', you need to exclude your manifest file, since you don't want to overwrite the server's version of this.&nbsp;</div><div><br/></div><div>My excluded path says this: C:/Users/roland/WebstormProjects/Example/app/manifest.webapp</div><div><br/></div><div>[[File:Webstorm configuration upload 3.png]]<br/></div><div><br/></div><div>You can experiment with 'automatic upload' to upload files automatically as you save them.</div><div><br/></div><div>Remember that you have to refresh your browser to get the new files. They are cached in your browser.&nbsp;</div><div><br/></div>
</p><p><br />
 
<img _fck_mw_valid="false" _fck_mw_filename="Webstorm configuration upload 1" alt="" class="fck_mw_notfound" />
 
</p><p><img _fck_mw_valid="false" _fck_mw_filename="Webstorm configuration upload 2" alt="" class="fck_mw_notfound" />
 
</p><p>You should exclude your manifest file from being uploaded, since the one on your local disk should be different from the one that's on the server. The one on the server is changed automatically as the app is installed.  
 
</p><p><img _fck_mw_valid="false" _fck_mw_filename="Webstorm configuration upload 3" alt="" class="fck_mw_notfound" />
 
</p><span class="fck_mw_category" sort="">Pages with broken file links</span>
 

Latest revision as of 14:46, 12 November 2014

You can set up webstorm to deploy your local project files using SFTP (SSH) to the group server. This is a simple way to update your server so that you can test the files. Other IDEs support similar deployment functions, but Webstorm only is covered here. 

First install an app using the standard web dhis interface. You files will be available in a folder like this:

/usr/share/tomcat/webapps/ROOT/apps/app-name

which will be the following address on your server:

http://servername/apps/app-name

Go to Tools->Deployment->Configuration in the menu. 

A window will appear, and click + to add a new service.
Webstorm configuration upload 1.png
 

Then enter your server name, '/' as the root path and your UIO username and password (the same as you use to SSH into the server). 

Then under mappings, add a mapping directory. 

The local path should be on your local hard-disk, where your project is. 

For me this is: C:\Users\roland\WebstormProjects\Example\app

The deployment path is the path on the server where Webstorm will copy the files from your local directory. It should look something like this:

/usr/share/tomcat/webapps/ROOT/apps/app-name

but instead of app-name, use your app-name 

TIP: Set up separate app names for each group member, so you can use the same server but have parallell apps. 

The web path would be something like this: /apps/app-name


Webstorm configuration upload 2.png


Under 'Excluded paths', you need to exclude your manifest file, since you don't want to overwrite the server's version of this. 

My excluded path says this: C:/Users/roland/WebstormProjects/Example/app/manifest.webapp

Webstorm configuration upload 3.png

You can experiment with 'automatic upload' to upload files automatically as you save them.

Remember that you have to refresh your browser to get the new files. They are cached in your browser.