Anyway, the situation I ran into is that my install of 11AS is on a hosted server back at HQ. And I'm using JDeveloper 10.1.3 on my laptop here in Adelaide. So any time I wanted to deploy the applications to test them, I had to manually SCP/SFTP the application archive up to the server then deploy it. I know its trivial, but it was becoming a pain in the arse after a while. It's kind of funny how something so incidental sometimes becomes a beast of burden.
How could I make my life easier? Well I was just about to write myself a 5 line Ant script to do it, which used the
Hmm I said out loud -- could I just use that instead?
Well all you need to do is crack open the External Tools menu item and Add a new item.
To copy a file from my local PC to the server, I ultimately need a command that looks like this :
pscp -pw password username@server:/dir
All you need to do then is to fill in the relevant fields to produce that command.
There are some nice elements in the dialog that help you construct the generic command. I used three of these in my command:
- To allow me to enter the password when the command is run, I used the prompt directive:
${prompt:label=Password} - To specify the file to upload, I used the file.path directive:
${file.path} - To specify the target server, I used an environment variable substitution. I'm lazy and to avoid typing, I set the common target server details as an environment variable so that from the command line I can use some shorthand like this "pscp %SCP% ...". To include the environment variable, I used the env.var directive:
${env:var=SCP}
Cool.
Now to put it to use.
When I want to copy an application archive up to my server for deployment, all I need to do is select the archive in the Navigator and select PSCP from the right mouse menu:
The password is then queried:
And finally the full command is constructed and run:
Voila.
One gotcha I found was that the deployment archives are not shown by default in the various JDeveloper Navigators (why it doesn't show them in a "deploy" directory in the navigator BTSOOM).
So to force JDeveloper to show you the generated archives, add the "deploy" directory to the Project Content directories:
----------------
Listening to: Ride - Twisterella
No comments:
Post a Comment