This clickstart sets up a build service, repository and a basic GlassFish app with continuous deployment. All built by maven.
Launch this clickstart and glory could be yours too ! Use it as a building block if you like. You can launch this on Cloudbees via a clickstart automatically, or follow the instructions below.
This is based on the GlassFish stack that you can read more about here.
bees app:create -a my-glassfish3-app -t glassfish3
bees db:create my-glassfish3-db
bees app:bind -a my-glassfish3-app -db my-glassfish3-db -as mydb
Supported JNDI names:
jdbc/mydb
: unqualified relative JNDI name is supported / OKjava:comp/env/jdbc/mydb
: qualified private name is supported / OKandjava:jdbc/mydb
: qualified relative names are not supported by Glassfish / KOjava:/jdbc/mydb
: qualified global name is not supported by Glassfish / KOjava:global/env/jdbc/mydb
Samples:
Context ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("jdbc/mydb");
DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/mydb");
bees config:set -a my-glassfish3-app -R glassfish3.auth-realm.database=mydb
bees app:deploy -a my-glassfish3-app path/to/my/app.war
Create a new Maven project in Jenkins, changing the following:
-
Add this git repository (or yours, with this code) on Jenkins
-
Also check "Deploy to CloudBees" with those parameters:
Applications: First Match Application Id: MYAPP_ID Filename Pattern: target/*.war
where MYAPP_ID
is the name of your application.