-
Notifications
You must be signed in to change notification settings - Fork 0
Deploying to Heroku
-
Create an Heroku free account. Heroku is an example of a Platform-as-a-Service (PaaS) provider.
-
Follow the Getting Started with Java on Heroku instructions, with the following differences:
-
On the "Introduction" step, there is no need to install Maven 3. We will be using a Gradle based build process instead.
-
On the "Prepare the app" step, use the https://github.com/isel-leic-ls/1415-2-common repository, instead of the https://github.com/heroku/java-getting-started.
-
On the "Deploy the app" step,
- Define an explicit name when creating the application on Heroku - e.g.
heroku create s1516-2-LI41D-G00
- The output of the
git push heroku master
command will be different, since we are using an alternative build process based on Gradle instead of on Maven.
- Define an explicit name when creating the application on Heroku - e.g.
-
On the "Define a Procfile" step, use the one already defined on the repository.
-
Follow the Using a hosted SQL Server instructions, to setup an SQL Server in AppHarbor (another example of a PaaS provider). When you can successfully establish a connection to the SQL Server instance, using SQL Management Studio, return to the Heroku setup.
-
Change source file HerokuFirstHttpServer.java to use StudentsServlet.
-
StudentServlet
uses three environment variable. Configure them at the provider, using theheroku config:set
command. Use the values ofHostname
,Username
andPassword
, of the SQL Server instance, to define variables nameddbserver
,dbuser
anddbpassword
. -
Commit your local changes and push to the
heroku
remote. Test the new application.
-
The used build process is based on Gradle and not on Maven.
-
The Gradle build file uses the
application
plugin to create an installation. -
The
Procfile
is using a shell script created by application installation.