massyl / virtual-vehicles-docker

Repository for files related to containerizing Virtual-Vehicles project, using Docker. See blog post below for project details.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Continuous Integration and Delivery of Microservices

Continuous Integration and Delivery of Microservices-based REST API with RestExpress, Java EE, and MongoDB, using Jenkins CI, Docker Machine, and Docker Compose.

In the below series of posts, we learned how to use Jenkins CI, Maven, Docker, Docker Compose, and Docker Machine to take a set of Java-based microservices from source control on GitHub, to a fully tested set of integrated Docker containers running within an Oracle VirtualBox VM. We performed integration tests, using a scripted set of synthetic transactions, to make sure the microservices were functioning as expected, within their containers.

ELK Stack 3D Diagram

Reference Blog Posts
Build the 'test' Environment Project
# check current versions of required apps
docker -v && docker-compose -v && \
    docker-machine -v && VBoxManage --version

# pull this GitHub project
git clone https://github.com/garystafford/virtual-vehicles-docker.git
cd virtual-vehicles-docker

# clean up any previous machine failures
docker-machine stop test || echo "nothing to stop" && \
docker-machine rm test   || echo "nothing to remove"

# use docker-machine to create and configure 'test' environment
docker-machine --debug create --driver virtualbox test
eval "$(docker-machine env test)"

# pull build artifacts from virtual-vehicles-demo project
# build (4) Dockerfiles and docker-compose.yml from templates
sh pull_and_build.sh

# use docker-compose to pull and build new images and containers
# this will take up to 20 minutes or more to pull images
docker-compose -p jenkins up -d

# list machines, images, and containers
docker-machine ls && docker images && docker ps -a

# wait for containers to fully start before tests fire up
sleep 30

# add local dns name to hosts file for demo
echo "$(docker-machine ip test)   api.virtual-vehicles.com" | \
  sudo tee --append /etc/hosts

# test the services
sh tests_color.sh $(docker-machine ip test)
# alternate: sh tests_color.sh api.virtual-vehicles.com

# tear down: stop and remove 'test' environment when complete
docker-machine stop test && docker-machine rm test

Integration Tests

Browse the Project

ELK Ports

About

Repository for files related to containerizing Virtual-Vehicles project, using Docker. See blog post below for project details.

License:Apache License 2.0


Languages

Language:Shell 94.8%Language:Nginx 3.6%Language:Go 1.6%