Skip to content

A proof-of-concept for deploying spring-cloud and angular via ansible

License

Notifications You must be signed in to change notification settings

chen0040/ansible-erp-deploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ansible-erp-deploy

A proof-of-concept for deploying spring-cloud solution via ansible

Features

This demo will deploy the spring-cloud sample project at https://github.com/chen0040/spring-erp-clients at a single computer, which is specified as the development environment in the devops/ansible/erp.inventory.development. To deploy the solution across multiple computers or deploy it on a production environment, simply update the erp.inventory.development or erp.inventory.production

Prerequisites

The ansible solution assumes that you are using linux operating system (in particular CentOS), if you are using Windows, you can cd to the project root directory and run the following environment to create a CentOS vm (at 192.168.10.13 as specified by Vagrant.config.yml) using Vagrant:

vagrant up

Once you have the CentOS system, you must ensure that the machine has Java 8 and Ansible installed. If not, you can run the following script to install these tools:

devops/sbin/env_setup.sh

Install spring-cloud cluster

Once git clone this project on the CentOS environment or started a CentOS Vagrant VM on Windows, cd to the project root folder and run the following command to start installing the spring-cloud cluster jars:

cd devops/ansible
ansible-playbook install-erp.yml -u root -i erp.inventory.development

Start spring-cloud cluster

Now to start the spring-cloud cluster, run the following command:

cd devops/ansible
ansible-playbook start-erp.yml -u root -i erp.inventory.development

At this point, the spring cluster will be running with the following micro-services:

Test the spring-cloud cluster

To test whether the system is running,run the following command:

curl http://localhost:9020/greetings

Test the spring-cloud cluster using angular

You can also test whether the system is running by starting the angular server using the following command:

sudo yum install -y nodejs
sudo npm install -g @angular/cli
cd devops/ng4-erp
npm install
ng serve --proxy-config proxy.conf.json --host 0.0.0.0 --disable-host-check --port 8080

This time navigate to http://localhost:8080 in your host computer's web browser

By the way, if you are using a Vagrant CentOS on Windows, then the last line of command should become:

ng serve --proxy-config proxy.conf.vagrant.json --host 192.168.10.13 --disable-host-check --port 8080

This time navigate to http://192.168.10.13:8080 in your host computer's web browser

Stop spring-cloud cluster

To stop the spring-cloud cluster,run the following command:

cd devops/ansible
ansible-playbook stop-erp.yml -u root -i erp.inventory.development

About

A proof-of-concept for deploying spring-cloud and angular via ansible

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published