-
-
Save toomasr/4001366 to your computer and use it in GitHub Desktop.
Revisions
-
toomasr revised this gist
Nov 2, 2012 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,7 +18,7 @@ REPO=$1 START_TAG=$2 MVN_COMMAND="mvn clean install" SONAR_COMMAND="mvn sonar:sonar -DskipTests=true -Psonar" if [ -z "$REPO" ]; then echo "Missing program argument: repository" @@ -29,6 +29,7 @@ fi pushd $REPO TAGS="`hg tags`" OLDIFS=$IFS IFS=" " @@ -47,6 +48,7 @@ do SONAR_PROJECT_COMMAND="$SONAR_COMMAND -Dsonar.projectDate=$TAG_DATE" IFS=$OLDIFS echo "Executing Maven: $MVN_COMMAND" $MVN_COMMAND > /tmp/sonarifying.log 2>&1 echo "Executing Sonar: $SONAR_PROJECT_COMMAND" -
toomasr revised this gist
Nov 2, 2012 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,6 +29,9 @@ fi pushd $REPO TAGS="`hg tags`" IFS=" " for tag in $TAGS do if [[ -n "$START_TAG" && "$START_TAG" > "$tag" ]] ; then -
toomasr revised this gist
Nov 2, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,7 +18,7 @@ REPO=$1 START_TAG=$2 MVN_COMMAND="mvn clean install" SONAR_COMMAND="mvn sonar:sonar" if [ -z "$REPO" ]; then echo "Missing program argument: repository" -
toomasr revised this gist
Nov 2, 2012 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,6 +12,8 @@ This little Bash script illustrates the concept. To spell out what it does in hu ```bash #!/bin/bash REPO=$1 START_TAG=$2 @@ -43,9 +45,9 @@ do SONAR_PROJECT_COMMAND="$SONAR_COMMAND -Dsonar.projectDate=$TAG_DATE" echo "Executing Maven: $MVN_COMMAND" $MVN_COMMAND > /tmp/sonarifying.log 2>&1 echo "Executing Sonar: $SONAR_PROJECT_COMMAND" $SONAR_PROJECT_COMMAND > /tmp/sonarifying.log 2>&1 done popd ``` -
toomasr revised this gist
Nov 2, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -35,7 +35,7 @@ do fi STAG=$(echo $tag | cut -d' ' -f1) TAG_DATE=`hg log -r$STAG --style=compact | head -n1 | cut -d' ' -f7` echo "Checking out source from $TAG_DATE tagged as $tag" hg update -r $STAG -C -
toomasr revised this gist
Nov 2, 2012 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -46,7 +46,6 @@ do $MVN_COMMAND echo "Executing Sonar: $SONAR_PROJECT_COMMAND" $SONAR_PROJECT_COMMAND done popd ``` -
toomasr revised this gist
Nov 2, 2012 . 1 changed file with 0 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,9 +27,6 @@ fi pushd $REPO TAGS="`hg tags`" for tag in $TAGS do if [[ -n "$START_TAG" && "$START_TAG" > "$tag" ]] ; then -
toomasr revised this gist
Nov 2, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,8 +9,8 @@ By combining this property and what your version system does best, track changes This little Bash script illustrates the concept. To spell out what it does in human readable form: > for each tag in the given Mercurial repository, checkout the source and run sonar, using the tag date as projectDate ```bash REPO=$1 START_TAG=$2 -
toomasr revised this gist
Nov 2, 2012 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ By combining this property and what your version system does best, track changes This little Bash script illustrates the concept. To spell out what it does in human readable form: > for each tag in the given Mercurial repository, checkout the source and run sonar, using the tag date as projectDate ```bash #!/bin/bash REPO=$1 @@ -52,6 +52,7 @@ do exit done popd ``` You can of course modify this script to fit your own need. Maybe you want to checkout the history pr week or pr month instead of using tags. It's up to you. -
toomasr revised this gist
Nov 2, 2012 . 1 changed file with 40 additions and 32 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,49 +1,57 @@ When you do your first [Sonar](http://sonarsource.org) run on your project, you get a lot of new quality numbers to play with, but no trends. You only have one data set for comparison, the now picture. Wouldn't it be nice if you could see the current trend of the project without waiting a couple of month for the 'daily/weekly' Sonar runs to fill up the data? Well, you're in luck! And if you're using Mercurial as a version system as well, this is your day. :) In the [Sonar Advanced Parameter](http://docs.codehaus.org/display/SONAR/Advanced+parameters) documentation you will find a System Property called *sonar.projectDate*. The property let you tell Sonar when in time the running analysis was ran. By combining this property and what your version system does best, track changes to source, we can now play back the history of the project as far as Sonar is concerned. This little Bash script illustrates the concept. To spell out what it does in human readable form: > for each tag in the given Mercurial repository, checkout the source and run sonar, using the tag date as projectDate #!/bin/bash REPO=$1 START_TAG=$2 MVN_COMMAND="mvn clean install" SONAR_COMMAND="mvn sonar:sonar -DskipTests=true -Psonar" if [ -z "$REPO" ]; then echo "Missing program argument: repository" echo "Usage: ./sonar_history.sh repository_path [start-tag]" exit fi pushd $REPO TAGS="`hg tags`" #IFS=" #" for tag in $TAGS do if [[ -n "$START_TAG" && "$START_TAG" > "$tag" ]] ; then echo "Skipping $tag (start tag $START_TAG)" continue fi STAG=$(echo $tag | cut -d' ' -f1) TAG_DATE=`hg log -rtip --style=compact | head -n1 | cut -d' ' -f7` echo "Checking out source from $TAG_DATE tagged as $tag" hg update -r $STAG -C SONAR_PROJECT_COMMAND="$SONAR_COMMAND -Dsonar.projectDate=$TAG_DATE" echo "Executing Maven: $MVN_COMMAND" $MVN_COMMAND echo "Executing Sonar: $SONAR_PROJECT_COMMAND" $SONAR_PROJECT_COMMAND exit done popd You can of course modify this script to fit your own need. Maybe you want to checkout the history pr week or pr month instead of using tags. It's up to you. -
aslakknutsen revised this gist
Jun 17, 2012 . No changes.There are no files selected for viewing
-
aslakknutsen revised this gist
Jun 17, 2012 . 1 changed file with 0 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,3 @@ When you do your first [Sonar](http://sonarsource.org) run on your project, you get a lot of new quality numbers to play with, but no trends. You only have one data set for comparison, the now picture. Wouldn't it be nice if you could see the current trend of the project without waiting a couple of month for the 'daily/weekly' Sonar runs to fill up the data? Well, you're in luck! And if you're using git as a version system as well, this is your day. :) -
aslakknutsen revised this gist
May 18, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,7 +26,7 @@ This little Bash script illustrates the concept. To spell out what it does in hu fi pushd $GIT_REPO for tag in `git tag` do if [[ -n "$START_TAG" && "$START_TAG" > "$tag" ]] ; then echo "Skipping $tag (start tag $START_TAG)" -
aslakknutsen revised this gist
May 18, 2012 . 1 changed file with 33 additions and 34 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,41 +13,40 @@ This little Bash script illustrates the concept. To spell out what it does in hu > for each tag in the given git repository, checkout the source and run sonar, using the tag date as projectDate GIT_REPO=$1 START_TAG=$2 MVN_COMMAND="mvn clean install" SONAR_COMMAND="mvn org.codehaus.sonar:sonar-maven3-plugin:3.0:sonar" if [ -z "$GIT_REPO" ]; then echo "Missing program argument: repository" echo "Usage: ./sonar_history.sh git_repository_path [start-tag]" exit fi pushd $GIT_REPO for tag in `git tag` do if [[ -n "$START_TAG" && "$START_TAG" > "$tag" ]] ; then echo "Skipping $tag (start tag $START_TAG)" continue fi TAG_DATE=`git show $tag --date=iso | grep Date: -m1 | cut -d' ' -f 4` echo "Checking out source from $TAG_DATE tagged as $tag" git checkout $tag > /dev/null 2>&1 git clean -df > /dev/null 2>&1 SONAR_PROJECT_COMMAND="$SONAR_COMMAND -Dsonar.projectDate=$TAG_DATE" echo "Executing Maven: $MVN_COMMAND" $MVN_COMMAND > /dev/null 2>&1 echo "Executing Sonar: $SONAR_PROJECT_COMMAND" $SONAR_PROJECT_COMMAND > /dev/null 2>&1 done popd You can of course modify this script to fit your own need. Maybe you want to checkout the history pr week or pr month instead of using tags. It's up to you. -
aslakknutsen renamed this gist
May 18, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
aslakknutsen revised this gist
Apr 19, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ By combining this property and what your version system does best, track changes This little Bash script illustrates the concept. To spell out what it does in human readable form: > for each tag in the given git repository, checkout the source and run sonar, using the tag date as projectDate ```bash GIT_REPO=$1 -
aslakknutsen revised this gist
Apr 19, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ How to import your project's history in Sonar --------------------------------------------- When you do your first [Sonar](http://sonarsource.org) run on your project, you get a lot of new quality numbers to play with, but no trends. You only have one data set for comparison, the now picture. -
aslakknutsen revised this gist
Apr 19, 2012 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -47,4 +47,8 @@ do $SONAR_PROJECT_COMMAND > /dev/null 2>&1 done popd ``` You can of course modify this script to fit your own need. Maybe you want to checkout the history pr week or pr month instead of using tags. It's up to you. Have fun! :) -
aslakknutsen revised this gist
Apr 19, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ When you do your first [Sonar](http://sonarsource.org) run on your project, you Wouldn't it be nice if you could see the current trend of the project without waiting a couple of month for the 'daily/weekly' Sonar runs to fill up the data? Well, you're in luck! And if you're using git as a version system as well, this is your day. :) In the [Sonar Advanced Parameter](http://docs.codehaus.org/display/SONAR/Advanced+parameters) documentation you will find a System Property called *sonar.projectDate*. The property let you tell Sonar when in time the running analysis was ran. By combining this property and what your version system does best, track changes to source, we can now play back the history of the project as far as Sonar is concerned. -
aslakknutsen revised this gist
Apr 19, 2012 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ How to import your project version history in Sonar --------------------------------------------------- When you do your first [Sonar](http://sonarsource.org) run on your project, you get a lot of new quality numbers to play with, but no trends. You only have one data set for comparison, the now picture. Wouldn't it be nice if you could see the current trend of the project without waiting a couple of month for the 'daily/weekly' Sonar runs to fill up the data? Well, you're in luck! And if you're using git as a version system as well, this is your day. :) -
aslakknutsen revised this gist
Apr 19, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ When you do your first [Sonar](http://sonarsource.org) run on your project, you get a lot of new quality numbers to play with, but no trends. You only have one data set for comparison, the now picture. Wouldn't it be nice if you could see the current trend of the project without waiting a couple of month for the 'daily/weekly' Sonar runs to fill up the data? Well, you're in luck! And if you're using git as a version system as well, this is your day. :) In the [Sonar Advanced Parameter](http://docs.codehaus.org/display/SONAR/Advanced+parameters) documentation you will find a System Property called @sonar.projectDate@. The property let you tell Sonar when in time the running analysis was ran. By combining this property and what your version system does best, track changes to source, we can now play back the history of the project as far as Sonar is concerned. -
aslakknutsen revised this gist
Apr 19, 2012 . 1 changed file with 11 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,14 @@ When you do your first Sonar:sonarsource.org run on your project, you get a lot of new quality numbers to play with, but no trends. You only have one data set for comparison, the now picture. Wouldn't it be nice if you could see the current trend of the project without waiting a couple of month for the 'daily/weekly' Sonar runs to fill up the data? Well, you're in luck! And if you're using git as a version system as well, this is your day. :) In the "Sonar Advanced Parameter":http://docs.codehaus.org/display/SONAR/Advanced+parameters documentation you will find a System Property called @sonar.projectDate@. The property let you tell Sonar when in time the running analysis was ran. By combining this property and what your version system does best, track changes to source, we can now play back the history of the project as far as Sonar is concerned. This little Bash script illustrates the concept. To spell out what it does in human readable form: > for each tag in the given git repository, check out the source and run sonar, using the tag date as projectDate ```bash GIT_REPO=$1 -
aslakknutsen revised this gist
Apr 19, 2012 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,5 @@ ```bash GIT_REPO=$1 START_TAG=$2 -
aslakknutsen created this gist
Apr 19, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ ``` GIT_REPO=$1 START_TAG=$2 MVN_COMMAND="mvn clean install" SONAR_COMMAND="mvn org.codehaus.sonar:sonar-maven3-plugin:3.0:sonar" if [ -z "$GIT_REPO" ]; then echo "Missing program argument: repository" echo "Usage: ./sonar_history.sh git_repository_path [start-tag]" exit fi pushd $GIT_REPO for tag in `git tag` do if [[ -n "$START_TAG" && "$START_TAG" > "$tag" ]] ; then echo "Skipping $tag (start tag $START_TAG)" continue fi TAG_DATE=`git show $tag --date=iso | grep Date: -m1 | cut -d' ' -f 4` echo "Checking out source from $TAG_DATE tagged as $tag" git checkout $tag > /dev/null 2>&1 git clean -df > /dev/null 2>&1 SONAR_PROJECT_COMMAND="$SONAR_COMMAND -Dsonar.projectDate=$TAG_DATE" echo "Executing Maven: $MVN_COMMAND" $MVN_COMMAND > /dev/null 2>&1 echo "Executing Sonar: $SONAR_PROJECT_COMMAND" $SONAR_PROJECT_COMMAND > /dev/null 2>&1 done popd ```