Skip to content

dhamkannan/mongodb_cicd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CICD for deploying MongoDB cluster

Step by step guide for deploying MongoDB cluster with CICD on your machine

Tools

  • Docker
  • Ansible
  • Git (Gitlab)
  • Jenkins

How to Setup environments

Prerequisites

  • Download required version of MongoDB rpms and store it under src/mongo/<<version>>
  • Create rootCA and node certificates with openssl and store it under src/certs/<<version>>

Docker

  1. Install docker for desktop

  2. Create a external docker network with bridge driver:

    $ docker network create mongonetwork
    
  3. Create external volumes for gitlab & jenkins:

    $ docker volume create jenkins_home
    $ docker volume create gitlab_config
    $ docker volume create gitlab_logs
    $ docker volume create gitlab_data
    
  4. Build centos:base & jenkins images from respective docker files:

    $ docker build -t centos:base -f Dockerfiles/centos-base.Dockerfile .
    $ docker build -t jenkins:latest -f Dockerfiles/jenkins.Dockerfile .
    
  5. Start the containers with docker-compose:

    $ docker-compose up
    
  6. Start other required services:

    $ ./start_services.bat
    

Gitlab

  1. Setup gitlab root password on first time
  2. Setup a gitlab project
  3. Download and push the ansibleplaybooks section

images/gitlab.PNG

Jenkins

  1. Setup a jenkins project
  2. Enable webhook from gitlab

images/jenkins.PNG

About

CICD for deploying MongoDB cluster

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published