Ensure you have java 1.8 or above installed and environment variable $JAVA_HOME is also pointing to it.
#####Install maven (osx)-
brew install maven
#####Install postgres(osx)-
brew install postgres
#####Installing nodeJS (osx)
a) Using nvm:
Install nvm from: https://github.com/creationix/nvm then run this command to install 0.10.31 version of node - nvm install 0.10.31
b) Using brew:
brew install node
#####Commands:
create database "platform-dev";
create user "pg-dev" with password '';
grant all privileges on database "platform-dev" to "pg-dev";
#####Description: This will create a user "pg-dev"(with no password) and "platform-dev" DB and grant the privileges on that db to that user.
#####Command:
mvn clean install
#####Description: This will download all java dependencies and build the application and create target/platform-1.0-SNAPSHOT.jar This is a fat jar file which contains all the dependant jars packaged into it.
#####Commands:
npm install(place sudo before the command if npm is installed using brew)
bower install
#####Description: This pulls all the js dependancies, it also runs bower install in the end to pull bower dependancies.
#####Commands:
mvn clean install
java -jar target/platform-1.0-SNAPSHOT.jar server development.yml
#####Description: This starts the server with configuration specified in development.yml and uses the jar file created after maven compilation is done.
Read more about dropwizard [here]:dropwizard.io/getting-started.html
#####Commands:
mvn clean install
java -jar target/platform-1.0-SNAPSHOT.jar server development.yml
#####Description: This runs the migration against the connection string specified in developer.yml file.
#####Commands:
cd src/test/js
sh karmatest.sh
#####Description: This will generate the test-coverage report for the files specified in the karma.conf.js configuration file.
Coverage report file(index.html) location: Ajab-Shahar-TW ▸ src ▸ main ▸ resources ▸ assets ▸ app ▸ coverage ▸ PhantomJS 1.9.8 (Mac OS X)
Here's the box : smb://blrfs01/TeamShares/ajabshahar/ajabshahar.box
Prerequisites:
- install virtualbox
- install vagrant Vagrant installer: smb://blrfs01/TeamShares/ajabshahar/vagrant_1.7.2.dmg
- Vagrant file path: smb://blrfs01/TeamShares/ajabshahar/Vagrantfile
Steps to get your vm up and running:
-
copy the .box file to your system. Lets say to ~/VMs/ajabshahar
-
copy the attached vagrantfile to the folder '~/VMs/ajabshahar'
-
Clone the repo https://github.com/AjabShahar/scripts
-
Ensure that both the repos(ajabshahar and scripts) are siblings of each other i.e under the same folder. For eg: ~/projects/ should contain both ajabshahar repo and scripts repo.
-
Update the path to the both the repos in line no. 40 of the vagrant file i.e config.vm.synced_folder "path to ajab-shahar repos i.e ~/projects”, "/project”
-
cd to the vagrantfile folder i.e '~/VMs/ajabshahar' and type : vagrant box add ajabshahar ajabshahar.box
-
then run : vagrant up
-
To ssh into the new VM, use the command: vagrant ssh
-
The directory ‘/projects’ contains the deployed project.
-
Go inside the scripts folder and run the command: sudo sh deploy-ajabshahar.sh
-
deploy-ajabshahar.sh will copy the files(zip file for assets and jar file for server code) from your machine(the path configured in the vagrant file) to the VM.
-
To see your changes: a) If they are server side changes i.e java file changes under src, then: i. Create the jar file by using ‘mvn clean install’/ ii. Run ‘sh deploy-ajabshahar.sh’ inside the VM.
b) If they are static content changes i.e js, css and images, then: i. Run gulp zip ii. Run ‘sudo sh client_deployment.sh’ inside the VM.
13) To see the site use ip(of the VM) i.e http://192.168.33.10
- to get hot deployment of the client code, just add the following lines in ~/.bashrc of your vm
alias rs='rsync -a --delete /projects/Ajab-Shahar-TW/web/app/ /var/www/ajabshahar'
now to sync the code just type rs after any changes you make