Friday, July 20, 2018

Git best SCM practices - Git recommended branching strategy -


Find below typical Git branching strategy followed in agile teams:

    • Feature branch – developers may create this branchy for mostly every story during sprint.
    • Develop branch – after feature is developed, code will be merged to develop branch.
    • Release branch – Create this branch for every release, fix the defects raised during QA and release all the way to PROD.
    • Master branch – current prod release code. Once after every release, code needs to merged from release branch to master branch to keep the code in sync.
    • Hot fix branch - For any urgent bug fixes, after the fix is done, code needs to be merged to develop branch and master branch.

      Thursday, July 12, 2018

      Install Tomcat 8 on Ubuntu 16.0.4 - How to install and configure Tomcat 8 on Ubuntu 16.0.4

      Tomcat 8 Installation

      sudo apt-get update
      sudo apt-get install tomcat8
      sudo apt-get install tomcat8-docs tomcat8-examples tomcat8-admin
      sudo cp -r /usr/share/tomcat8-admin/* /var/lib/tomcat8/webapps/

      sudo vi /var/lib/tomcat8/conf/tomcat-users.xml
      Go to the end of the file,
      Add the below lines in second last line above (above </tomcat-users>)
      <role rolename="manager-gui"/>
      <role rolename="manager-script"/>
       
      <user username="tomcat" password="password" roles="manager-gui,manager-script"/>



      sudo vi /etc/default/tomcat8
      Look for the line starting JAVA_OPTS and comment that line by adding # and copy the below line:
      JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true -Xmx512m -XX:MaxPermSize=512m -XX:+UseConcMarkSweepGC"


      sudo systemctl restart tomcat8

      sudo systemctl status tomcat8

      Now go to browser, enter ip address or DNS name of server with port no 8080

      You will see a page that says It Works!

      That's is Tomcat is successfully installed on Ubuntu

      Why Git is Distributed ? Advantages of Git - How Git is different from traditional SCM tools?

      Most of version control systems such as SVN, TFVC or CVS work on client-server model. After making code changes, when developers check-in the code changes, it goes to central server. All history is being maintained in a central server, not locally.

      Whereas in Git, developers clone the remote repo into local machine which is called local repo. When they clone in local machine, all history is copied into local repo. After making code changes, when they commit the code, it goes into local repo with new version. Then they can push code changes into remote repo where it is available to others. Client and remote server will have full repository.

       

      Here below is the difference Git and other control systems:

      Area Git SVN/TFVC
      Repository type Distributed Centralized
      Full History Local machine Central machine
      Checkout They clone the whole repository and do locally changes Developer checkout working copy which is snapshot of a code
      Work Offline Yes No
      Branching and Merging Reliable, used often, supports fat forward merge and 3-way merge Reliable, use with caution
      Operations speed Fast and most are local Network-dependent
      Learning Curve Needs a bit time Relatively simple
      Staging area Supported to stash the temporary changes and retrieve it back later Not supported
      Collaboration model Repository-to-repository interaction Between working copy and central repo

      Friday, July 6, 2018

      Access denied for user 'sonar'@'localhost' (using password: YES) - MySQL Errors installing SonarQube

      Make sure you have setup user correctly in MySQL database and also correctly configured that user in sonar.properties.
       
      mysql -u root -p
      SHOW GLOBAL VARIABLES LIKE 'storage_engine’;
      CREATE USER 'sonar'@'localhost' IDENTIFIED BY 'password';
      CREATE DATABASE sonar;
      GRANT ALL PRIVILEGES ON sonar.* TO 'sonar'@'localhost';

      sudo vi /opt/sonarqube/conf/sonar.properties
      #uncomment  the below lines
      sonar.jdbc.username=sonar
      sonar.jdbc.password=password

      now start the server 
      sh /opt/sonarqube/bin/linux-x86-64/sonar.sh start
      for any issues, look at logs at 

      tail -f /opt/sonarqube/logs/sonar.log

      Thursday, July 5, 2018

      How to install Java on Ubuntu - Install JDK 1.8 on Ubuntu 16.0.4

      Find below steps for installing Oracle JDK 1.8 on Ubuntu 16.0.4 server

      sudo apt-get install default-jdk -y
      sudo apt-get update

      type below command to verify if java is installed

      java -version

      openjdk version "1.8.0_191"
      OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-2ubuntu0.16.04.1-b12)
      OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)