Giter Club home page Giter Club logo

microservice's Introduction

microservice

Screenshots

Activity Page Alt text

A Pull Request being Built in Staging Environment Alt text

A Successful Pull Request Built in Staging Environment Alt text

Continuous Integration System notification to GitHub when a PR is being built. Alt text

Continuous Integration System notification to GitHub upon a successful PR build. Alt text

Deploying on Docker

Create Docker Machine. Use this only if you have Docker Machine installed.

./1-docker_create-docker-machine.sh

Deploy MySQL

./2-docker_deploy-mysql.sh

Deploy the App

./3-docker_deploy-microservice.sh

Deploy the App using the Dockerfile in ./docker/microservice/

./3-docker_deploy-microservice-v2.sh

Clean up

./docker_cleanup.sh

Remove Docker Machine( optional)

./5-docker_remove-docker-machine.sh

Deploying on Kubernetes using kubectl( By default qa profile will be activated)

Deploy MySQL. Note that this Deployment uses Config Maps to initialize the Database.

./6-kubectl_deploy-mysql.sh

Deploy MySQL( Pass TARGET_IMAGE_NAME to push it to your own Image Repository). By default the Service will be deployed in LoadBalancer configuration. Furthermore qa Spring Profile will be activated. imagePullPolicy in the Deployment is set to Always to make sure the image gets downloaded everytime.

./7-kubectl_deploy-microservice.sh TARGET_IMAGE_NAME

Clean up

./8-kubectl_cleanup.sh

Deploying on Kubernetes using Helm

Deploy the app with Helm using the below command. Note that this script will initialize the Database with a Config Map and that can be maximum 1MB in size( need to confirm this).

./9-helm_deploy.sh

Deploy the app with Helm using the below command. It will build the MySQL image with the initialization scripts. The script assumes your App image is already in built and pushed.

./9-helm_deploy-v2.sh

Clean up

./9-helm_cleanup.sh

Configuring Jenkins

Adding the Pipeline to Jenkins

Open Blue Ocean Plugin. Alt text Click New Pipeline Button to create the new Pipeline. Alt text Jenkins will guide you through the rest of the process. Select GitHub then you may be asked to create a GitHub Access Token.

Adding Webhooks

Go to Credentials -> System -> Global Credentials and click Add Credentials. Alt text Select Secret Text. Then add a Shared Secret between Jenkins and Your GitHub Project. Alt text Go to Configuration( Manage Jenkins). Then click Advanced Button which comes under GitHub. Alt text Select your Shared Secret. Then click Save. Alt text Go to your GitHub Project Settings -> Webhooks. Click Add Webhook. Alt text Payload URL will be /github-webhook/. Select application/json as Content Type. Then select Send me everything under Triggers. Alt text Now you are all set. Alt text

Adding Environment Variables

To add Environment Variables for your Cluster go to Manage Jenkins Section. Alt text

Pull Request Build Strategy

In the Project Configuration select the option shown to prevent Branches associated with Pull Requests getting built twice. Alt text

Discarded Directory

You might find some useful code snippets in ./discarded directory.

ToDos

  • Handle Webhook Events from the Jenkinsfile( Commits, Tags, PRs)
  • Build the App
  • Push the App to Dockerhub or some private Repository
  • Deploy the App( Using helm)
  • Rollback ( Using Helm)
  • Infrastructure Configuration( In the Infrastructure Repo)
  • Make use of skipping stages in Jenkins Pipelines( When Directive)

References

microservice's People

Contributors

pwelagedara avatar

Watchers

 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.