Skip to content

Simplest possible Java webapp for testing deployments

Notifications You must be signed in to change notification settings

idlv75/hello-world-war

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hello World! (Java CI Flow)

This is a simple Maven project that:

  • builds a WAR file
  • deploys the WAR file to a docker image
  • implements a simple Jenkins DSL Release Flow.

Environment Setup

  1. Download and Install Vagrant.
  2. Download and install VirtualBox.
  3. Start a Vagrant box with Docker. For example: williamyeh/ubuntu-trusty64-docker.
vagrant init williamyeh/ubuntu-trusty64-docker
vagrant up

3.1 If required add configuration to the Docker service at: /etc/default/docker

3.2 Configure the "Port Forwarding" on the running VM in VirtualBox to expose the required ports for the Docker containers you would launch.

  1. Install Jenkins on the VM

  2. Add user jenkins to the docker group:

usermod -G docker jenkins
  1. Install JDK 8 (Optional: Configure in Jenkins)
apt-get install software-properties-common python-software-properties
add-apt-repository ppa:openjdk-r/ppa
apt-get update
apt-get install openjdk-8-jdk

There is a nasty bug installing JAVA on Ubuntu 14.04. The fix is simple:

apt-get install --reinstall ca-certificates-java
update-ca-certificates -f
  1. Install Maven (Optional: configure in Jenkins)
sudo apt-get purge maven maven2 maven3
sudo apt-add-repository ppa:andrei-pozolotin/maven3
sudo apt-get update
sudo apt-get install maven3
  1. Advanced SSH Configuration (In case you need it)

Jenkins Configuration

  1. Initialize Jenkins.
  2. Install the following plugins:
  • Job DSL Plugin
  • Release Plugin
  • Conditional Buildstep
  • Maven Release Plug-in
  1. Create a Jenkins Job DSL project and import a DSL script from the /dsl project directory

About

Simplest possible Java webapp for testing deployments

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Groovy 86.9%
  • Java 13.1%