Code Monkey home page Code Monkey logo

fccup's Introduction

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.

PROJECT CODE UPDATED 11-09-2017 to v4.3.0

Introduction

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 Test Environment Project

# check for latest versions of required apps
docker -v && docker-compose -v && \
docker-machine -v && VBoxManage --version

# pull this GitHub project
git clone https://github.com/ashishkothari13/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 test up -d

# list machines, images, and containers
# check all containers are running
docker-machine ls && \
docker images && \
docker ps -a

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

# add local dns name to hosts file for demo (mac-friendly)
sudo -- sh -c -e "echo '$(docker-machine ip test)   api.virtual-vehicles.com' >> /etc/hosts";

# test the services
sh tests_color.sh api.virtual-vehicles.com

# alternate, test the services using IP address:
# sh tests_color.sh $(docker-machine ip test)

# delete all images and containers
docker rmi -f $(docker images -a -q) && \
docker rm -f $(docker ps -a -q)

# alternate, complete tear down: stop and remove 'test' environment when complete
docker-machine stop test && \
docker-machine rm test
eval "$(docker-machine env -u)"

# other useful commands
# clean up orphaned volumes
docker volume rm $(docker volume ls -qf dangling=true)

# clean up orphaned networks
docker network rm $(docker network ls -q)

# delete all project images, but not base images
docker rmi -f $(docker images | grep 'test_' | awk '{print $3}')

# delete all <none> images
docker rmi -f $(docker images | grep '^<none>' | awk '{print $3}')

Test Results

Integration Tests

Browse the Project

Environment Architecture

ELK Ports

fccup's People

Contributors

ashishkothari13 avatar hgondaliya avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.