-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,5 @@ bin/* | |
*.bak | ||
*.sublime* | ||
**/overlay* | ||
rhc-port-forward-status | ||
etc/rhc-port-forward-status |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,29 @@ | ||
#!/bin/sh | ||
|
||
# kill any previous port forward | ||
# kill any previous port forward and the previous mark file about its status | ||
pkill -9 -f "rhc port-forward sonar [-]n lightblue" | ||
rm -f rhc-port-forward-status | ||
|
||
# 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 & | ||
# forward ports from openshift (assumes current server is openshift online and you're a member of the lightblue namespace). A new mark file will eb created if the return value of the rhc command is different than 0 | ||
rhc port-forward sonar -n lightblue || echo $? > rhc-port-forward-status & | ||
|
||
# wait a bit for port forwarding to fire up | ||
sleep 10 | ||
|
||
# if the file exists, log the error and exit 1 | ||
if [ -f "rhc-port-forward-status" ] | ||
then | ||
echo "Error on rhc port-forward. Error code:" | ||
cat rhc-port-forward-status | ||
rm -f rhc-port-forward-status | ||
# rhc process should dead, so it would not need pkill -9 -f "rhc port-forward sonar [-]n lightblue" | ||
exit 1 | ||
fi | ||
|
||
# build and publish | ||
mvn clean install -Dmaven.test.failure.ignore=true | ||
mvn -e -B sonar:sonar | ||
|
||
# cleanup port forwarding | ||
# cleanup port forwarding & mark file | ||
pkill -9 -f "rhc port-forward sonar [-]n lightblue" | ||
rm -f rhc-port-forward-status |