Saturday 14 December 2019

GIT Pull Using Nodejs

GIT Pull Using Nodejs

I am sharing my code to take GIT pull through NodeJS. May be this small code can help someone.

// create config module
var config = {};
to_dir_client = "path to folder...";
client_git_repo = "Bitbucket URL... ";

// export config object as a node module
export default config;

/*-----------------------------------------------------------
--- install git repo js file
-----------------------------------------------------------*/
// include modules
import config, { to_dir_client, client_git_repo } from './config';
import gitP from 'simple-git/promise';

// install repo
const git_client = gitP(to_dir_client);
git_client.checkIsRepo()
   .then(isRepo => !isRepo && initialiseClientRepo(git_client))
   .then(() => git_client.pull('origin', 'master'));

// function to add origin
function initialiseClientRepo (git) {
   return git.init()
      .then(() => git.addRemote('origin', client_git_repo))
}

Friday 13 December 2019

SonarQube Scanner Local Windows

SonarQube Scanner Windows

I am sharing my tutorial to describes how to run a Sonar Scanner on Windows machine.

Add the project to SonarQube, In SonarQube, go to






Enter Project Key


Enter Project Key which can be used later to identify the project.




















New project created. 



Download SonarQube Scanner


Windows Installer

















Install SonarQube on Windows














Installation Guide

Go through the installation and running scanner manual online https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/

  My Local Instance

    My test local instance looks like

There is only one file to review t.php















My sonar.json looks like






My sonar-project.properties file looks like:














Running Sonar Scanner CLI





After scanning is done, we can see report in Sonarqube console like below:








Create .ICS file using PHP code

Recently worked on creating a .ics file in PHP after a very long time, code so thought to share with everybody. Please find below the comple...