5 Ağustos 2014 Salı

How to Setup SonarQube on Mac Part-2

Today I will talk about how to install MySQL and its dependencies in order to complete my SonarQube installation progress.

I always use Homebrew when I install any software tools.

I will start to download MySQL by using brew install mysql

After that I need to set environment of the MySQL so I'm opening vim editor with this command:

vim .bash_profile and then I need to add these lines:

export MYSQL_HOME=/usr/local/mysql-5.6.19-osx10.7-x86_64
export MYSQL=$MYSQL_HOME/bin
export PATH=$MYSQL:$PATH

At this step you need to download and install MySQL 6.1.7 in order to start and stop MySQL server by using this path:http://dev.mysql.com/downloads/file.php?id=452671

By the way,you need to have an account in order to access download link there.

After you click Next and install successfully you should to see MySQL under Apple Logo ->System Preferences ->MySQL Image at the end of the page

Here is image of the MySQL:



Now I'm able to use mysql command in my terminal when I write it, I should to see this lines:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 17
Server version: 5.6.19 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql> 

We can connect to MySQL Workbench after I open MySQL port and I perform any query on this platform.






24 Temmuz 2014 Perşembe

How to Setup SonarQube on Mac Part-1

After 6 days break,Today I will continuous mentioning different topic which is "Sonar"

What's the Sonar?
Sonar is an open source platform for continuous inspection of the code quality.

I will mention how to setup on Mac step by step.

The official website of the Sonar says that "The only prerequisite for running SonarQube is to have Java (Oracle JRE 6 onwards) installed on your machine."

I want to mention Homebrew in this tutorial.I actually can download and install Sonar by using its offical website as Jenkins installation process.However,This time installation process will be different than before.

What's the Homebrew?

Homebrew is the package management system for Mac Operating System.

How can I Install it? 

by entering this command in terminal:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

After I install homebrew into my machine I need to update brew for whether its installed successfully or not so I run this command in terminal: brew update

I'm ready to install Sonar using these commands:

brew install sonar
brew install sonar-runner

After I execute these commands Sonar should be under this path:/usr/local/Cellar/sonar(brew always install under the /usr/local/Cellar/...)

This step is same with Jenkins installation so I need to set environment path of the Sonar

All exports should be like this:

export SONAR_HOME=/usr/local/Cellar/sonar-runner/2.4/libexec
export SONAR=$SONAR_HOME/bin
export PATH=$SONAR:$PATH

echo $SONAR_HOME and $SONAR should return above paths.

After I set all export commands I can start to run Sonar in terminal by using this command:

/usr/local/opt/sonar/bin/sonar console 

or in current directory 

sonar start 

to stop:

sonar stop

After I used "sonar start" command I should to see main page of SonarQube on http://localhost:9000/ like below:







18 Temmuz 2014 Cuma

Configuration Jenkins Server


Today I'm gonna mention about how can we customize our Jenkins server configuration.

Firstly,opening Jenkins main page by entering http://localhost:8080/jenkins

After I opened the main page I need to sign up to the system by the help of login | sign up button at the upper right corner of the page.

Configure Global Security:

After I sign up to the server I can change my user setting by using this path: Manage Jenkins-->Configure Global Security

In this page,I need to pick Enable Security in order to change security settings

After that there are 2 titles in this page which are Security Realm and Authorization

In Security Realm; Jenkins' own user Database should be selected.

In Authorization;Matrix-based security should be selected.



MANAGE JENKINS PAGE

We can manage all settings of Jenkins server by using Manage Jenkins-->Configure System

Configure System Page:

In this page, we can determine where Android SDK is,JDK,Ant,Maven,Jenkins Location.I want to start with Android SDK path:

Android Configuration:

I determine where my Android SDK is by giving its path like this:

/Users/zafer/Desktop/adt-bundle-mac-x86_64-20140624/sdk(this is your android sdk path)

I recommend to click Automatically install Android components when required under the text box

Java JDK Configuration:

I also set JDK path by giving name and JAVA_HOME text input

As I said before,in order to get path of JAVA_HOME we need to write echo $JAVA_HOME in terminal and we should to see output like this:


/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home(this is where your JDK is located)

after that I need to copy this path to JAVA_HOME text input

if your build type is Ant you can download it from internet as shown there

Maven Configuration:

Actually this process is same with JDK configuration so just write echo $M2 to the terminal and we need to copy this path to the text box under the maven project configuration.

echo $M2 output should be like this:

/Users/zafer/Documents/dev/apache-maven-3.2.2/bin










17 Temmuz 2014 Perşembe

How to Setup Jenkins on Mac - Part 2

                             
                     SETUP JENKINS SERVER ON MAC

   Today I'm gonna talk about installing Jenkins Server.

 I installed all dependencies so we can continue.

As I mentioned before Tomcat is an application server so we can run our Jenkins server on it.

I will download jenkins.war from its official page and install on Apache Tomcat application server.

First of all I'm downloading jenkins.war from here:http://mirrors.jenkins-ci.org/war/latest/jenkins.war

I need to move jenkins.war file to where I downloaded Apache Tomcat application server.

I need to cut/paste to apache-tomcat-8.0.9/webapps

When I paste my jenkins.war file to that folder its turned into Jenkins folder automatically.

After all,I should to see my jenkins server on:http://localhost:8080/jenkins








16 Temmuz 2014 Çarşamba

How to Setup Jenkins on Mac - Part 1


                               SETUP JENKINS SERVER ON MAC 


I want to mention how to setup a Jenkins server on our Mac OSX machine.I will to explain setup process step by step so I will separate each step by numbers.


Before I start to setup Jenkins I need to install some dependencies which are Java 1.7 JDK,Maven 3.2.2),Apache Tomcat 8.

I'm starting to explain with first dependency which is Java JDK:


1)Setting Up Java JDK

Firstly I'm downloading java from its official web page by following this path:jdk-7u65-macosx-x64.dmg.After I downloaded necessary folders I need to set JAVA_HOME path for java jdk folder so I will use terminal in order to do that.In terminal,I can use vim text editor so I'm writing vim .bash_profile to go to the vim and then I need to write this command here:


export JAVA_HOME=$(/usr/libexec/java_home)

After I set JAVA_HOME I need to save and quit from vim editor so I need to click ESC button and then writing :wq! then  clicking ENTER button.

Finally I can complete my installing process by checking whether it's installed successfully or not so I need to use java -version command in terminal.

Output of this command should be like this:

java version "1.7.0_*"
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)

*(it can be 51-58-60)

I also need to see where java is installed by using echo $JAVA_HOME in terminal

It should returns a output like this:

/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home

2)Setting Up Maven

I can continuous with maven setup after I completed to install Java JDK on my machine. I need to download maven from this path:apache-maven-3.2.2-bin.tar.gz after I unzip and download I need set its M2 path in my machine so I need to use again vim text editor.I'm opening it by entering vim .bash_profile in terminal.After I opened vim editor I need to click I(letter) in order to insert new entry in vim text editor.

I need to add these export commands in my terminal:
export M2_HOME=/Users/zafer/Documents/dev/apache-maven-3.2.2
export M2=$M2_HOME/bin
export PATH=$M2:$PATH

All exports should be like this:

export JAVA_HOME=$(/usr/libexec/java_home)
export M2_HOME=/Users/zafer/Documents/dev/apache-maven-3.2.2
export M2=$M2_HOME/bin
export PATH=$M2:$PATH
export PATH=$JAVA_HOME/bin:$PATH

As I said before you need to shut down vim editor by clicking ESC button and then :wq! 

I need to check installing process whether its completed successfully or not so I'm writing 

mvn --version  

I should to see this output in my terminal:

Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T16:51:42+03:00)
Maven home: /Users/zafer/Documents/dev/apache-maven-3.2.2
Java version: 1.7.0_60, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.9.4", arch: "x86_64", family: "mac"

I also should to see where maven is installed by using this command in terminal:

echo $M2 

It should returns an output like this:

/Users/zafer/Documents/dev/apache-maven-3.2.2/bin


3)Setting Up Apache-Tomcat 8

We need manage our Jenkins by using any Application server so I prefer to use Apache Tomcat.Actually This process is simple easy just use this path:tar.gz  unzip and install on your local machine.

By the way,I can recommend to use Tomcat Controller in order to open and shut down our Tomcat Application Server easily.

We can download it from here:http://tomcat-controller.en.softonic.com/mac/download