Skip to content

Latest commit

 

History

History
122 lines (91 loc) · 3.05 KB

DEV-GUIDE-MACOSX.md

File metadata and controls

122 lines (91 loc) · 3.05 KB

CloudUnit developpement environment

You are reading the wright guide, if you want to setup an environment to contribute to CloudUnit development.

Requirements

  • A MacOSX computer
  • Vagrant 1.8+
  • Git / Java 1.8
  • Node 5.x
  • VirtualBox 5.0.4+
  • Maven 3

Architecture for developpment

Architecture Dev

General Rules

  • You have to configure a local dns (see further) to send any requests from your host to VM (IP fixed at 192.168.50.4)
  • You use your favorite idea (intellij, Eclipse) to develop the maven project into 'cloudunit/cu-manager'.
  • The backend is a spring application exposing a REST API
  • The frontend is an AngularJS 1.4 consuming the backend API from Spring Java
  • You run the project with an embedded tomcat via maven tasks (tomcat:run). No need to install Tomcat locally.
  • Mysql is included into vagrantbox so no need to install it locally.

Architecture sources

cloudunit/cu-manager        : Maven project for backend ui
cloudunit/cu-manager-ui     : Maven project for web ui
cloudunit/cu-cli            : Maven project for Spring Shell CLI
cloudunit/cu-compose        : Shell scripts for administration 
cloudunit/cu-services       : Docker images

Installation

Installation NPM

Mac Users are invited to follow the instructions given by the npm website

How to build Angular project

Follow these instructions

cd $HOME && git clone https://github.com/Treeptik/cloudUnit.git
cd $HOME/cloudUnit/cu-manager-ui && sudo npm install grunt -g
cd $HOME/cloudUnit/cu-manager-ui && sudo npm install grunt-cli -g
cd $HOME/cloudUnit/cu-manager-ui && sudo npm install bower -g
cd $HOME/cloudUnit/cu-manager-ui && sudo npm install -g n
cd $HOME/cloudUnit/cu-manager-ui && sudo n stable
cd $HOME/cloudUnit/cu-manager-ui && bower install

How to install Vagrant plugins

vagrant plugin install vagrant-reload
vagrant plugin install vagrant-vbguest

How to start Environment Developpment

1 - Start the vagrantbox and run Docker into Vagrant

cd $HOME/cloudUnit 
vagrant up
vagrant ssh 
cd cloudunit/cu-compose && ./reset-dev.sh

2 - Run the UI for development (http://0.0.0.0:9000) from Mac

$ cd $HOME/cloudUnit/cu-manager-ui && grunt serve

! Issue if you have the following issue

grunt-cli: The grunt command line interface (v1.2.0)
Fatal error: Unable to find local grunt.

Run the following command :

sudo npm update

3 - Start the Java Backend from Mac

cd $HOME/cloudUnit
mvn clean install -DskipTests
cd $HOME/cloudUnit/cu-manager
mvn clean compile tomcat7:run -DskipTests -Dspring.profiles.active=vagrant

You can use default password and login

login: johndoe
password: abc2015

How to reset Environment Developpment

cd $HOME/cloudUnit
vagrant ssh dev
cd cloudunit/cu-compose && ./reset-dev.sh

How to run e2e test (selenium & protractor)

First of all, you have to you have to install Google Chrome. Then, start the application in parallel.

cd $HOME/cloudunit/cu-manager-ui
grunt test