Skip to content
dukesbank sample application
Java Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

This is a collection of build and deployment automation examples built around the Duke's Bank J2EE sample

Amazon/EC2 Console and Auth Info:

  • Amazon EC2 Console Login
  • username:
  • password: NOT_SHOWN (can send if you need it)
  • SSH Key: dukesbank.dtolabs.com_rsa (can send if you need it)
  • Search for "" in instances search bar will list the dukesbank instances: build, repo, deploy, app

Start the EC2 Instances

Configure elastic IPs for: build, repo, deploy, and app as shown here via the EC2 Console:

(NOTE: elastic IPs will be disassociated from these instances then they are stopped, so when we start them they must be re-associated)

build i-276d1f5c (Jenkins)

repo i-3f512344 (Nexus)

deploy i-29572552 (Rundeck/Yum)

app i-1b5b2960 (JBoss)

spare i-a78e11dc

  • ElasticIP:

Jenkins Jobs:

  • All jobs are committed into source control: workshop/jenkins/
  • All jobs use: git://
  • Jboss_403: Produces JBoss RPM
  • DukesBank: Produces the DukesBank EAR RPM
  • DukesBank_Config: Produces the DukesBank Configuration RPM

Login to the repo node and start Nexus:

  Charles-Scotts-DTO-MacBook-Pro:2013Jan chuck$ ssh -i dukesbank.dtolabs.com_rsa -l ec2-user
  Last login: Tue Jan  8 18:02:07 2013 from
  [ec2-user@ip-10-144-14-176 ~]$ sudo su - repouser
  [repouser@ip-10-144-14-176 ~]$ cd nexus/nexus
  [repouser@ip-10-144-14-176 nexus]$ bin/nexus start

Rundeck Jobs:

  • All jobs are committed into source control: workshop/rundeck/
  • Start: Start JBoss
  • Stop: Stop JBoss
  • DeployFromJenkins: deploys the latest DukesBank ear (only) from Jenkins onto the app node
  • DeployFromNexus: deploys the selected DukesBank ear, config, and JBoss Container from Nexus onto the app node
  • Deploy: broken but appears to issue with reusing DeployFromNexus without any parameters being passed.


Yum Server is empty but available on the deploy server. Requires apache server and installed as follows with /var/www/html/yum as the yum root:

[ec2-user@deploy ~]$ hostname
[ec2-user@deploy ~]$ sudo yum -y install mod_ssl
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror, security
Determining fastest mirrors
 * base:
 * extras:
 * updates:
Running Transaction
  Installing : httpd-tools-2.2.15-15.el6.centos.1.x86_64                                                                                                                                        1/5 
  Installing : apr-util-ldap-1.3.9-3.el6_0.1.x86_64                                                                                                                                             2/5 
  Installing : mailcap-2.1.31-2.el6.noarch                                                                                                                                                      3/5 
  Installing : httpd-2.2.15-15.el6.centos.1.x86_64                                                                                                                                              4/5 
  Installing : 1:mod_ssl-2.2.15-15.el6.centos.1.x86_64                                                                                                                                          5/5 

  mod_ssl.x86_64 1:2.2.15-15.el6.centos.1                                                                                                                                                           

Dependency Installed:
  apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1            httpd.x86_64 0:2.2.15-15.el6.centos.1            httpd-tools.x86_64 0:2.2.15-15.el6.centos.1            mailcap.noarch 0:2.1.31-2.el6           

bash-4.1$ pwd
bash-4.1$ ls -ld yum
drwxr-xr-x 2 apache root 4096 Jan 10 22:09 yum
[ec2-user@deploy html]$  sudo service httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using for ServerName
                                                           [  OK  ]

Jenkins/Java Configuration

Development OpenJDK installed:

[ec2-user@build ~]$ hostname
[ec2-user@build ~]$ rpm -q java-1.6.0-openjdk-devel

Jenkins/Ant Configuraiton, see Jenkins Global Settings which is how jenkins finds Ant.

Ant is installed in: /opt/apache-ant-1.8.4

[ec2-user@build ~]$ hostname
[ec2-user@build ~]$ cd /opt/apache-ant-1.8.4/

requires ivy jar in ANT_HOME:

[ec2-user@build apache-ant-1.8.4]$ ls -l lib/ivy-2.3.0-rc1.jar 
-rw-r--r-- 1 root root 1214376 Aug 16 21:21 lib/ivy-2.3.0-rc1.jar

Obtain ivy jar from:

Charles-Scotts-DTO-MacBook-Pro:Downloads chuck$ gunzip -c apache-ivy-2.3.0-rc2-bin.tar.gz |tar tf - |grep \.jar$

and drop into $ANT_HOME/lib

Trigger a CI build and deploy with the Rundeck/Jenkins plugin:

In a DukesBank checkout, we will change Bank message from Duke to Acme by committing a change to the file:

[chuck@app dukesbank]$ pwd
[chuck@app dukesbank]$  find . -name -print
[chuck@app dukesbank]$ vi ./src/j2eetutorial14/examples/bank/web/
[chuck@app dukesbank]$ git diff ./src/j2eetutorial14/examples/bank/web/
diff --git a/src/j2eetutorial14/examples/bank/web/ b/src/j2eetutorial14/examples/bank/web/
index a8fed89..269f687 100644
--- a/src/j2eetutorial14/examples/bank/web/
+++ b/src/j2eetutorial14/examples/bank/web/
@@ -25,7 +25,7 @@ LogonReturn=Return to log in page.
 CustomerId=Customer ID:
-Welcome=Welcome to Duke's Bank.
+Welcome=Welcome to Acme's Bank.
 Farewell=Thank you for banking with Anthony's Bank.
 [chuck@app dukesbank]$ git commit -m 'change welcome msg' ./src/j2eetutorial14/examples/bank/web/
 [chuck@app dukesbank]$ git commit --all
Something went wrong with that request. Please try again.