0

I've been developing a web app on localhost for the past few months and now I wanna keep developing it on a remote server for a more realistic environment. I have a google compute engine instance ( a remote machine with my webServer on it ) running and it takes me too much time to get my project from eclipse to my deployment server. Since I suppose this is a common use case and I'm totally new to all this I'd like some tips to speed up the process.

At the moment here are the steps I go through to get my app from localhost to the remote webServer :

  • In eclipse right click on project -> Export as War
  • git add, git commit, git push to get my project to git repository
  • git clone on the remote google cloud machine
  • Then copy the file to my destination deployment folder

This takes about 5-10 minutes to do and it seems to be a very inefficient way to do things. Especially step 2 and 3 are frustrating. While I was developing on localhost I could see the result in seconds.

How can I make the process faster ?

Ced
  • 15,847
  • 14
  • 87
  • 146
  • 2
    Instead of exporting the war file locally and then cloning it on remote server, I would suggest clone your source code (not war) on remote server and build the war file using ant/maven or any other tool on the remote server itself. That way you will not have to transfer huge file over the network. – Vishal Jun 01 '16 at 02:46

1 Answers1

1

I would suggest using rsync on your generated web archive. I'm confused why you have to involve git in all of this, especially cloning is suspicious.

Leave your first step as is. Install rsync (on Windows you can get rsync as part of msys2 or find some other alternative).

Then you can use ssh with rsync to copy the file to the server:

rsync -e ssh app.war cloud_host:staging/dir

Make sure there is an old version of app.war in staging directory - rsync will only update differing blocks which in my practice takes less than a second for 50 MB archive. Then you can copy that archive to deployment directory of your server, if your server is deleting or moving this file from it.

Michał Grzejszczak
  • 2,599
  • 1
  • 23
  • 28