Git Overview

Git is a distributed Version Control System.

This video explains (with demo) basic operations to start using Git:

  1. Comparison with Centralized VCS
  2. Staging Area and Lifecycle of a File
  3. Commonly used commands
  4. Branching and Merging

Tools used:

  1. Git v2.34.1.windows.1 on MS Windows 10
  2. Git Extensions v3.4.3.9999
  3. kdiff3 v0.9.97
  4. gitlab.com account
Git Basics Demo

Setup SONAR with PostgreSQL DB

Objective: Setup a Sonar server pointing to a PostgreSQL DB server that can be used by multiple maven clients (developers) remotely

Software:

  1. Sonar 2.8
  2. PostgreSQL server 9.2
  3. Maven 3.3

Prerequisite: Maven and Sonar are already installed. Project repository contains sonar specific dependencies.

Procedure:

Setup PostgreSQL DB server

  1. Install postgreSQL 9.2
  2. Use pgAdmin III to create a new Login Role
    1. Username: sonar
    2. Password: sonar
  3. Create a new Database ‘sonar’ having owner ‘sonar’ login role.

Point SONAR to PostgreSQL DB

  • Update <sonar_home>\conf\sonar.properties
    • Comment sonar.jdbc.* properties to deactivate the default embedded database (derby)
    • Uncomment sonar.jdbc.* properties to use PostgreSQL

sonar.jdbc.url:                            jdbc:postgresql://<ip_address_of_postgresql_server>/sonar
sonar.jdbc.driverClassName:                org.postgresql.Driver
sonar.jdbc.validationQuery:                select 1

  • Copy postgresql-9.2-1002.jdbc3.jar to <sonar_home>\extensions\jdbc-driver\postgresql
  • Update <maven_home>\conf\settings.xml to add a profile for sonar

  <profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<sonar.jdbc.url>
jdbc:postgresql://<ip_address_of_postgresql_server>/sonar
</sonar.jdbc.url>
<sonar.jdbc.driverClassName>org.postgresql.Driver</sonar.jdbc.driverClassName>
<sonar.jdbc.username>sonar</sonar.jdbc.username>
<sonar.jdbc.password>sonar</sonar.jdbc.password>
<sonar.host.url>
http://<ip_address_of_sonar_server>:9000
</sonar.host.url>
</properties>
</profile>

  • Add IP address of machine where maven build is going to be executed to <postgresql_home>\data\pg_hba.conf

host       all          all          <IP address of maven build machine>/32         trust