Skip to content

Commit

Permalink
Merge pull request #407 from Sunbird-Saral/v1-develop
Browse files Browse the repository at this point in the history
changes related to release v1.6.1
  • Loading branch information
harish-challa committed Sep 29, 2023
2 parents 187b1d8 + e6da990 commit 59d42b1
Show file tree
Hide file tree
Showing 138 changed files with 5,716 additions and 1,874 deletions.
13 changes: 12 additions & 1 deletion Jenkinsfile-prod
Expand Up @@ -5,7 +5,7 @@ pipeline {
stages{
stage ('checkout') {
steps {
git branch: 'feature/saveMarks-v1', url: 'https://github.com/Sunbird-Saral/Project-Saral.git'
git branch: 'main', url: 'https://github.com/Sunbird-Saral/Project-Saral.git'
}
}

Expand Down Expand Up @@ -35,5 +35,16 @@ pipeline {
sh './deploy_EKS.sh'
}
}
stage('SonarQube analysis') {
steps{
withSonarQubeEnv('saralsonar9.0.1') {
sh '''
cd v1.0/backend/
npm install
npm run sonar
'''
}
}
}
}
}
19 changes: 19 additions & 0 deletions ansible-roles/inventory/hosts
@@ -0,0 +1,19 @@

[jenkins_hosts]
localhost

[mongo_configs]
#172.17.0.8 new_hostname=mongo-shard-configs-1 mongoc_private_ip=172.17.0.8
#172.17.0.9 new_hostname=mongo-shard-configs-2 mongoc_private_ip=172.17.0.9
[mongo_mongos]
#172.17.0.10 new_hostname=mongo-shard-mongos-1 mongo_private_ip=172.17.0.10
#172.17.0.11 new_hostname=mongo-shard-mongos-2 mongo_private_ip=172.17.0.11
[mongo_shard]
#this has to setup for 3 times, each time only two servers should active.
#172.17.0.12 mongod_port=27017 new_hostname=mongo-shard-data-1 mongo_private_ip=172.17.0.12
#172.17.0.13 mongod_port=27017 new_hostname=mongo-shard-data-2 mongo_private_ip=172.17.0.13
#172.17.0.14 mongod_port=27017 new_hostname=mongo-shard-data-3 mongo_private_ip=172.17.0.14
#172.17.0.15 mongod_port=27017 new_hostname=mongo-shard-data-4 mongo_private_ip=172.17.0.15
#172.17.0.16 mongod_port=27017 new_hostname=mongo-shard-data-5 mongo_private_ip=172.17.0.16
#172.17.0.17 mongod_port=27017 new_hostname=mongo-shard-data-6 mongo_private_ip=172.17.0.17

9 changes: 9 additions & 0 deletions ansible-roles/main/mongo_configs.yml
@@ -0,0 +1,9 @@
---
- hosts: mongo_configs
become: yes
roles:
- role: ./roles/bennojoy.mongo_mongoc
mongoc_datadir_prefix: "/var/lib/mongodb"
mongoc_port: 27017
mongoc_admin_pass: myadminpass
mongoc_replicaset: ulcaconfigs
11 changes: 11 additions & 0 deletions ansible-roles/main/mongo_mongos.yml
@@ -0,0 +1,11 @@
---
- hosts: mongo_mongos
become: yes
roles:
- role: ./roles/bennojoy.mongo_mongos
mongo_datadir_prefix: "/var/lib/mongodb"
mongo_port: 27017
mongoc_private_ip1: 172.17.0.8
mongoc_private_ip2: 172.17.0.9
mongoc_admin_pass: <testpass>
mongoc_replicaset: ulcaconfigs
9 changes: 9 additions & 0 deletions ansible-roles/main/mongo_shard.yml
@@ -0,0 +1,9 @@
---
- hosts: mongo_shard
become: yes
roles:
- role: ./roles/bennojoy.mongo_shard
mongo_datadir_prefix: "/var/lib/mongodb"
mongo_port: 27017
mongoc_admin_pass: <testpass>
mongo_shard_replicaset: <shard>
8 changes: 8 additions & 0 deletions ansible-roles/roles/ansible-java-8/defaults/main.yaml
@@ -0,0 +1,8 @@
---

java_archive_name: jdk-8u131-linux-x64.tar.gz
java_download_url: 'http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz'
#java_download_url: 'https://download.oracle.com/otn/java/jdk/8u211-b12/478a62b7d4e34b78b671c754eaaf38ab/{{ java_archive_name }}'
#java_download_url: 'http://download.oracle.com/otn-pub/java/jdk/8u112-b15/{{ java_archive_name }}'
java_root_dir: /usr/share/java-1.8.0
java_jdk_dir: '{{ java_root_dir }}/jdk1.8.0_131'
21 changes: 21 additions & 0 deletions ansible-roles/roles/ansible-java-8/meta/main.yml
@@ -0,0 +1,21 @@
---
galaxy_info:
author: Simon Leigh
description: Oracle Java 8 JDK
license: MIT
min_ansible_version: 2.x
platforms:
- name: Fedora
versions:
- all
- name: EL
versions:
- all
galaxy_tags:
- java
- java8
- jdk
- jdk8
- oracle

dependencies: []
74 changes: 74 additions & 0 deletions ansible-roles/roles/ansible-java-8/tasks/main.yaml
@@ -0,0 +1,74 @@
---

- name: Check if Java has already been downloaded and unpacked
stat:
path: '{{ java_jdk_dir }}'
register: dir

- name: Download Java JDK
get_url:
url: "{{ java_download_url }}"
headers: "Cookie: oraclelicense=accept-securebackup-cookie"
dest: /tmp/
# when: not dir.stat.exists
tags:
- java_install

- name: Create Java directory
file:
name: "{{ java_root_dir }}"
state: directory
when: not dir.stat.exists
tags:
- java_install

- name: Install tar
yum: pkg=tar
- name: Install wget
yum: pkg=wget

- name: Install unzip
yum: pkg=unzip
- file:
path: "/tmp/{{ java_archive_name }}"

# Untar the downloaded Java archive. The owner and group must be set otherwise the folder
# structure is created using numerical values for these.
- name: Unpack Java JDK
unarchive:
src: /tmp/{{ java_archive_name }}
dest: "{{ java_root_dir }}"
copy: no
owner: root
group: root
when: not dir.stat.exists
tags:
- java_install

# Use the alternatives command to install the appropriate links to the executables in the PATH.
# Alternatives allows multiple versions of Java to be installed with the correct executable
# on the PATH being used.
- name: Install Java alternatives
alternatives:
name: java
link: /usr/bin/java
path: '{{ java_jdk_dir }}/bin/java'
tags:
- java_install_alternatives

# Cleanup install by deleting downloaded Java archive
- name: Delete Java JDK tar.gz file
file:
path: /tmp/{{ java_archive_name }}
state: absent
tags:
- java_cleanup

# Set Ansible fact that Java has completed installation. This is so that this role can be used in
# other dependent roles. Those roles can check for this fact to determine whether or not this role
# should be run. Failing to do so will mean that this role is executed even if it has already been run.
- name: Set fact java_8_installed
set_fact:
java_8_installed: true
tags:
- java_install
1 change: 1 addition & 0 deletions ansible-roles/roles/ansible-java-8/tests/inventory
@@ -0,0 +1 @@
localhost
6 changes: 6 additions & 0 deletions ansible-roles/roles/ansible-java-8/tests/test.yaml
@@ -0,0 +1,6 @@
---

- hosts: localhost
remote_user: root
roles:
- ansible-java-8
54 changes: 54 additions & 0 deletions ansible-roles/roles/bennojoy.mongo_mongoc/README.md
@@ -0,0 +1,54 @@
mongo_mongoc
------------

This roles helps to install and configure the mongo configuration servers.

In addition to this role if combined with other roles like mongo_mongod, mongo_mongos, mongo_shard this can used to
build a production grade mongodb cluster with multi replication master and shards.


Requirements
------------

This role requires ansible 1.4 or higher and platform requirements are listed in the metadata file.

Role Variables
--------------

The variables that can be passed to this role and a brief description about them are as follows:


mongoc_datadir_prefix: /data/ # The data directory prefix where the configurations should be stored
mongoc_port: 2800 # The port for mongoc daemon
mongoc_admin_pass: "foobar" # The administrator passoword for monogc


Examples
-------

1) Eg: Install mongoc on all nodes in inventory.

- hosts: all
roles:
- role: bennojoy.mongo_mongoc
mongoc_datadir_prefix: "/data/"
mongoc_port: 2800
mongoc_admin_pass: foobar


Dependencies
------------

None

License
-------

BSD

Author Information
------------------

Benno Joy


7 changes: 7 additions & 0 deletions ansible-roles/roles/bennojoy.mongo_mongoc/defaults/main.yml
@@ -0,0 +1,7 @@
---

# The global variable file mongodb installation

mongoc_datadir_prefix: /data/
mongoc_port: 2800
mongoc_admin_pass: "foobar"
6 changes: 6 additions & 0 deletions ansible-roles/roles/bennojoy.mongo_mongoc/files/10gen.repo
@@ -0,0 +1,6 @@
[10gen]
name=10gen Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
gpgcheck=0
enabled=1

8 changes: 8 additions & 0 deletions ansible-roles/roles/bennojoy.mongo_mongoc/files/epel.repo
@@ -0,0 +1,8 @@
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=0

3 changes: 3 additions & 0 deletions ansible-roles/roles/bennojoy.mongo_mongoc/files/secret
@@ -0,0 +1,3 @@
qGO6OYb64Uth9p9Tm8s9kqarydmAg1AUdgVz+ecjinaLZ1SlWxXMY1ug8AO7C/Vu
D8kA3+rE37Gv1GuZyPYi87NSfDhKXo4nJWxI00BxTBppmv2PTzbi7xLCx1+8A1uQ
4XU0HA
@@ -0,0 +1,2 @@
install_date: Thu Jun 3 16:53:20 2021
version: master
19 changes: 19 additions & 0 deletions ansible-roles/roles/bennojoy.mongo_mongoc/meta/main.yml
@@ -0,0 +1,19 @@
---
galaxy_info:
author: "Benno Joy"
company: Ansible
license: BSD
min_ansible_version: 1.4
platforms:
- name: EL
versions:
- 6
- name: Ubuntu
versions:
- precise
- quantal
- raring
categories:
- database:nosql
dependencies: []

0 comments on commit 59d42b1

Please sign in to comment.