From 7463956513b77d86e5e233e9376e23a277058457 Mon Sep 17 00:00:00 2001 From: Naveen Malik Date: Mon, 19 Jan 2015 11:00:09 -0500 Subject: [PATCH 1/2] Moved stuff to etc dir --- .travis.yml | 2 +- release.sh | 51 --------------------------------------------------- settings.xml | 42 ------------------------------------------ sonar.sh | 17 ----------------- 4 files changed, 1 insertion(+), 111 deletions(-) delete mode 100755 release.sh delete mode 100644 settings.xml delete mode 100755 sonar.sh diff --git a/.travis.yml b/.travis.yml index eec9c37..fa258b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ jdk: - openjdk7 - oraclejdk8 before_install: - - cp ./settings.xml ~/.m2/ + - cp ./etc/settings.xml ~/.m2/ after_success: - "[[ $TRAVIS_BRANCH == \"master\" ]] && [[ $TRAVIS_JDK_VERSION == \"openjdk7\" ]] && { mvn clean deploy -DskipTests; };" - mvn clean test jacoco:report coveralls:jacoco diff --git a/release.sh b/release.sh deleted file mode 100755 index 5658e5c..0000000 --- a/release.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh - -# https://github.com/lightblue-platform/lightblue-docs-developer/issues/6 - -RELEASE_VERSION=$1 -DEVEL_VERSION=$2 - -if [ $1"x" == "x" ] || [ $2"x" == "x" ]; then - echo "Usage: ./release.sh " - echo "Example: ./release 1.1.0 1.2.0-SNAPSHOT" - exit 1 -fi - -# prepare and verify state -git fetch --all -rm -rf ~/.m2/repository/com/redhat/lightblue/ - -BRANCH=`git branch | grep ^* | awk '{print $2}'` - -if [ $BRANCH != "master" ]; then - read -p "Current branch is '${BRANCH}', not 'master'. Do you wish to continue? (y/N) " - if [ "$REPLY" != "y"]; then - exit 1 - fi -fi - -# check that local branch is equal to upstream master (assumes remote of origin) -MERGE_BASE=`git merge-base HEAD origin/master` -HEAD_HASH=`git rev-parse HEAD` - -if [ $MERGE_BASE != $HEAD_HASH ]; then - echo "Local branch is not in sync with origin/master. Fix and run this script again." - exit 1 -fi - -# update to non-snapshot versions of lightblue dependencies and commit -mvn versions:update-properties -DallowSnapshots=false -git commit -a -m "Updated versions to non snapshot" - -# prepare for release (note, this will warn if any snapshot dependencies still exist and allow for fixing) -mvn release:prepare -P release \ - -DpushChanges=false \ - -DreleaseVersion=$RELEASE_VERSION \ - -DdevelopmentVersion=$DEVEL_VERSION \ - -Dtag=V${RELEASE_VERSION} || exit - -# push prepared changes (doing separate just to have control) -git push origin master --tags - -# perform release -mvn release:perform -P release || exit diff --git a/settings.xml b/settings.xml deleted file mode 100644 index 245d7c2..0000000 --- a/settings.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - securecentral - - - - securecentral - - - - central - https://repo1.maven.org/maven2 - - true - - - - - - central - https://repo1.maven.org/maven2 - - true - - - - - - - - sonatype-nexus-snapshots - ${env.SONATYPE_USERNAME} - ${env.SONATYPE_PASSWORD} - - - sonatype-nexus-staging - ${env.SONATYPE_USERNAME} - ${env.SONATYPE_PASSWORD} - - - diff --git a/sonar.sh b/sonar.sh deleted file mode 100755 index 002d1fc..0000000 --- a/sonar.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -# kill any previous port forward -pkill -9 -f "rhc port-forward sonar [-]n lightblue" - -# forward ports from openshift (assumes current server is openshift online and you're a member of the lightblue namespace) -rhc port-forward sonar -n lightblue & - -# wait a bit for port forwarding to fire up -sleep 10 - -# build and publish -mvn clean install -Dmaven.test.failure.ignore=true -mvn -e -B sonar:sonar - -# cleanup port forwarding -pkill -9 -f "rhc port-forward sonar [-]n lightblue" From ce52e4dfa9f488ec97f5f590c86547f5e649d371 Mon Sep 17 00:00:00 2001 From: Naveen Malik Date: Tue, 20 Jan 2015 13:39:30 -0500 Subject: [PATCH 2/2] Added etc/ dir, oops --- etc/release.sh | 51 ++++++++++++++++++++++++++++++++++++++++++++++++ etc/settings.xml | 42 +++++++++++++++++++++++++++++++++++++++ etc/sonar.sh | 17 ++++++++++++++++ 3 files changed, 110 insertions(+) create mode 100755 etc/release.sh create mode 100644 etc/settings.xml create mode 100755 etc/sonar.sh diff --git a/etc/release.sh b/etc/release.sh new file mode 100755 index 0000000..5658e5c --- /dev/null +++ b/etc/release.sh @@ -0,0 +1,51 @@ +#!/bin/sh + +# https://github.com/lightblue-platform/lightblue-docs-developer/issues/6 + +RELEASE_VERSION=$1 +DEVEL_VERSION=$2 + +if [ $1"x" == "x" ] || [ $2"x" == "x" ]; then + echo "Usage: ./release.sh " + echo "Example: ./release 1.1.0 1.2.0-SNAPSHOT" + exit 1 +fi + +# prepare and verify state +git fetch --all +rm -rf ~/.m2/repository/com/redhat/lightblue/ + +BRANCH=`git branch | grep ^* | awk '{print $2}'` + +if [ $BRANCH != "master" ]; then + read -p "Current branch is '${BRANCH}', not 'master'. Do you wish to continue? (y/N) " + if [ "$REPLY" != "y"]; then + exit 1 + fi +fi + +# check that local branch is equal to upstream master (assumes remote of origin) +MERGE_BASE=`git merge-base HEAD origin/master` +HEAD_HASH=`git rev-parse HEAD` + +if [ $MERGE_BASE != $HEAD_HASH ]; then + echo "Local branch is not in sync with origin/master. Fix and run this script again." + exit 1 +fi + +# update to non-snapshot versions of lightblue dependencies and commit +mvn versions:update-properties -DallowSnapshots=false +git commit -a -m "Updated versions to non snapshot" + +# prepare for release (note, this will warn if any snapshot dependencies still exist and allow for fixing) +mvn release:prepare -P release \ + -DpushChanges=false \ + -DreleaseVersion=$RELEASE_VERSION \ + -DdevelopmentVersion=$DEVEL_VERSION \ + -Dtag=V${RELEASE_VERSION} || exit + +# push prepared changes (doing separate just to have control) +git push origin master --tags + +# perform release +mvn release:perform -P release || exit diff --git a/etc/settings.xml b/etc/settings.xml new file mode 100644 index 0000000..245d7c2 --- /dev/null +++ b/etc/settings.xml @@ -0,0 +1,42 @@ + + + + securecentral + + + + securecentral + + + + central + https://repo1.maven.org/maven2 + + true + + + + + + central + https://repo1.maven.org/maven2 + + true + + + + + + + + sonatype-nexus-snapshots + ${env.SONATYPE_USERNAME} + ${env.SONATYPE_PASSWORD} + + + sonatype-nexus-staging + ${env.SONATYPE_USERNAME} + ${env.SONATYPE_PASSWORD} + + + diff --git a/etc/sonar.sh b/etc/sonar.sh new file mode 100755 index 0000000..002d1fc --- /dev/null +++ b/etc/sonar.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +# kill any previous port forward +pkill -9 -f "rhc port-forward sonar [-]n lightblue" + +# forward ports from openshift (assumes current server is openshift online and you're a member of the lightblue namespace) +rhc port-forward sonar -n lightblue & + +# wait a bit for port forwarding to fire up +sleep 10 + +# build and publish +mvn clean install -Dmaven.test.failure.ignore=true +mvn -e -B sonar:sonar + +# cleanup port forwarding +pkill -9 -f "rhc port-forward sonar [-]n lightblue"