The IT Alchemy Lab really doesn't have any set "purpose" to speak of. It is more about the IT technologies and issues I come across in my day-to-day business, meetings and chats (lunches, coffee and drinks) with my IT colleagues and friends.

Blog Archive

Tuesday, August 23, 2011

Heroku PostgreSQL on the Cedar (java) stack

Found a few articles the other day on the web where you could use the cedar stack to deploy java apps [cedar stack reference].  Found it interesting, reached out to my dev's (who are Heroku masters) and ask for their help to teach the old dog some new tricks.  I managed to get it all up and running. Then when I wanted to connect to the PostgreSQL database I could only find ruby examples.   I hacked on it for a while and finally managed to get the solution up and running.  If you want the source code, you can visit my public git site and pull it down or visit my Heroku cedar stack for a demo.

Heroku instance
Github public project


Once you have your Github and Heroku account, upload your ssl keys, download the software from github and execute the following to deploy the application.
> git init
> git add .
> git commit -m "initial import"
> heroku create --stack cedar
> git push heroku master


Now, if you get some wierd ssl error, that is due to ssl issue, you're in for a fun ride. It is recoverable, but it can be a very nasty headache. I have found that on windows I have to reset my key weekly - on Linux, "one and done".  Here are some sites I used to help me figure these hurdles out: 
Github

Github setup and key generation (windows)
Github setup (linux)

To import your SSL Cert into github:
after you create you key, open ~/.ssh/id_rsa.pub, copy the full text
now, login to github, in the top right select "Account Settings", then "SSH Public Keys", "Add another public key" ... give it a name and paste the contents of ~/.ssh/id_rsa.pub
Save .. done.

Heroku
install Heroku on windows
install Heroku on Linux

adding the keys to heroku, very easy:
heroku keys:add
done ...

Good luck!

No comments:

About Me

My photo
Don't tell people how to do things, tell them what to do and let them surprise you with their results. --General George S. Patton
Open Source Links | Sourceforge | Slashdot | Open Source