Last Updated: February 25, 2016
·
2.991K
· Imad BOUHAMIDI

Setting up a development environment for JHipster application using Vagrant, Docker and Jenkins CI

alt text


This is an example of using Vagrant, Docker and Jenkins to build isolated and repeatable development environments for JHipster application.

Before we get started download and install these required tools:

Requirement

Geting started

After installing Vagrant it will be automatically added to the Path, if its not try to restart your computer.

to verify installation: open windows cmd prompt and type “vagrant -v”

create your own workspace folder:

and clone the project from github

mkdir vagrant
cd vagrant
git clone https://github.com/imad-bouhamidi/vagrant-docker-jenkins-jhipster
cd vagrant-docker-jenkins-jhipster
vagrant up

Wait, wait and wait until the installation is complete :p

Vagrant VM

Now you can connect to your Vagrant VM via vagrant ssh:

password: vagrant

vagrant ssh
vagrant@127.0.0.1's password: 
Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-46-generic x86_64)
 * Documentation:  https://help.ubuntu.com/

 System information disabled due to load higher than 1.0

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud


Last login: Wed Apr  1 16:34:29 2015 from 10.0.2.2
vagrant@OmniDevOps:~$

Docker JHipster container

Connect to docker and generate JHipster application

password: jhipster

ssh -p 4022 jhipster@ localhost
cd /jhipster
yo jhipster

And answer the questions asked by the generator to create an application taylored to your needs

If you prefer to use Maven, you can also run your application by typing:

mvn spring-boot:run

The application will be available on http://localhost:8080 and your code source generated inside a the synced folder named jhipster inside your vagrant-docker-jenkins-jhipster workspace

Jenkins CI

Your Jenkinc CI will be available on
http://localhost:8081 with plugins and dependencies installed.

What it is doing under the hood

  • Install the latest version of Docker
  • Pull the JHipster Docker image
  • Install latest version of jenkins
  • Install all Jenkins plugins and dependencies given in parameter

Now you will be able to import your code source generated by JHipster inside your fav IDE, and start coding ;)

Et voila!! happy coding

(!) please comment below for any clarifications