Skip to content

Instantly share code, notes, and snippets.

@lielran
lielran / Json
Created June 2, 2014 08:22
Jenkins -Test Result
http://server.jenkins.com/job/[JOB NAME]/lastBuild/testReport/api/json?pretty=true
@lielran
lielran / Sonar coverage
Created June 2, 2014 08:18
Python -Sonar Json parsing
http://www.cambus.net/parsing-json-from-command-line-using-python/
curl -v --user sonar:sonar "http://sonar.sonar.com:9000/api/resources?resource=[project:sonar:key]&metrics=coverage" | python -c 'import sys, json; print json.load(sys.stdin)[0]["msr"][0]["frmt_val"]'
@lielran
lielran / gist:9c44554d25a258703334
Last active August 29, 2015 14:02
Maven - change version to all poms
mvn versions:set -DnewVersion=${RELEASE_VERSION} -DgenerateBackupPoms=false
@lielran
lielran / gist:0f6d5e7c5d5e6cdf0d91
Created June 2, 2014 06:29
increment a release version and return it to snapshot
echo "###############################" > /dev/null 2>&1
echo "# Bump Snapshot Version #" > /dev/null 2>&1
echo "###############################" > /dev/null 2>&1
#remove minor version (from 1.6.0.25 --> 1.6.0)
SNAPSHOT_VERSION=$(echo $RELEASE_VERSION |grep -oP ".*\." |rev |cut -c 2- | rev)
#increment - http://stackoverflow.com/questions/8653126/how-to-increment-version-number-in-a-shell-script
@lielran
lielran / Maven - get Snapshot version from pom
Last active November 16, 2019 05:31
Jenkins get Maven Version and save it to properties file
echo "######Getting Dev Version From Pom##########" > /dev/null 2>&1
SNAPSHOT="-SNAPSHOT";
DEV_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dq -Dexpression=project.version | grep -v '\[');
export RELEASE_VERSION="$(echo $DEV_VERSION | sed "s@$SNAPSHOT@@").$BUILD_NUMBER";
# First verify the version of Java being used is not SunJSK.
java -version
# Get the latest Sun Java SDK from Oracle http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u1-download-513651.html
wget http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.rpm
# Rename the file downloaded, just to be nice
mv jdk-7u1-linux-i586.rpm\?e\=1320265424\&h\=916f87354faed15fe652d9f76d64c844 jdk-7u1-linux-i586.rpm
# Install Java