Skip to content

Commit

Permalink
Added etc/ dir, oops
Browse files Browse the repository at this point in the history
  • Loading branch information
jewzaam committed Jan 20, 2015
1 parent 805645c commit ce52e4d
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 0 deletions.
51 changes: 51 additions & 0 deletions etc/release.sh
Original file line number Diff line number Diff line change
@@ -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 <release version> <new snapshot version>"
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
42 changes: 42 additions & 0 deletions etc/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<settings>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>securecentral</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>securecentral</id>
<!--Override the repository (and pluginRepository) "central" from the Maven Super POM -->
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<servers>
<server>
<id>sonatype-nexus-snapshots</id>
<username>${env.SONATYPE_USERNAME}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
<server>
<id>sonatype-nexus-staging</id>
<username>${env.SONATYPE_USERNAME}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
</servers>
</settings>
17 changes: 17 additions & 0 deletions etc/sonar.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit ce52e4d

Please sign in to comment.