Browse Source

Fix build

- upgrade orchestrator from 3.9-SNAPSHOT to 3.9
 - use latest parent pom in integration tests
 - support Java 7 for analysis from Travis
tags/2.5.1
Simon Brandhof 8 years ago
parent
commit
378a8d9d46

+ 0
- 1
.gitignore View File

@@ -1,4 +1,3 @@

# ---- Maven
target/
dependency-reduced-pom.xml

+ 1
- 5
.sonarsource.properties View File

@@ -1,6 +1,2 @@
# Sonarsource meta data file for this project

# Wallboard
# teamAtSonarSource drives in which wallboard the alerting will be sent
# platform , language, infra
# Wallboard used in SonarSource offices
wallboard.teamAtSonarSource=platform

+ 2
- 2
it/pom.xml View File

@@ -6,7 +6,7 @@
<parent>
<groupId>org.sonarsource.parent</groupId>
<artifactId>parent</artifactId>
<version>23</version>
<version>26</version>
<relativePath />
</parent>

@@ -31,7 +31,7 @@
<dependency>
<groupId>org.sonarsource.orchestrator</groupId>
<artifactId>sonar-orchestrator</artifactId>
<version>3.9-SNAPSHOT</version>
<version>3.9</version>
</dependency>
<dependency>
<groupId>junit</groupId>

+ 5
- 5
it/src/test/java/com/sonar/runner/it/CacheTest.java View File

@@ -1,7 +1,7 @@
/*
* SonarSource :: IT :: SonarQube Scanner
* Copyright (C) 2009 SonarSource
* sonarqube@googlegroups.com
* Copyright (C) 2009-2016 SonarSource SA
* mailto:contact AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -13,9 +13,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package com.sonar.runner.it;


+ 5
- 5
it/src/test/java/com/sonar/runner/it/JavaTest.java View File

@@ -1,7 +1,7 @@
/*
* SonarSource :: IT :: SonarQube Scanner
* Copyright (C) 2009 SonarSource
* sonarqube@googlegroups.com
* Copyright (C) 2009-2016 SonarSource SA
* mailto:contact AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -13,9 +13,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package com.sonar.runner.it;


+ 5
- 5
it/src/test/java/com/sonar/runner/it/MultimoduleTest.java View File

@@ -1,7 +1,7 @@
/*
* SonarSource :: IT :: SonarQube Scanner
* Copyright (C) 2009 SonarSource
* sonarqube@googlegroups.com
* Copyright (C) 2009-2016 SonarSource SA
* mailto:contact AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -13,9 +13,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package com.sonar.runner.it;


+ 5
- 5
it/src/test/java/com/sonar/runner/it/ScannerTestCase.java View File

@@ -1,7 +1,7 @@
/*
* SonarSource :: IT :: SonarQube Scanner
* Copyright (C) 2009 SonarSource
* sonarqube@googlegroups.com
* Copyright (C) 2009-2016 SonarSource SA
* mailto:contact AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -13,9 +13,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package com.sonar.runner.it;


+ 5
- 5
it/src/test/java/com/sonar/runner/it/SonarScannerTestSuite.java View File

@@ -1,7 +1,7 @@
/*
* SonarSource :: IT :: SonarQube Scanner
* Copyright (C) 2009 SonarSource
* sonarqube@googlegroups.com
* Copyright (C) 2009-2016 SonarSource SA
* mailto:contact AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -13,9 +13,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package com.sonar.runner.it;


+ 9
- 0
pom.xml View File

@@ -183,4 +183,13 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>it</id>
<modules>
<module>it</module>
</modules>
</profile>
</profiles>
</project>

+ 36
- 41
travis.sh View File

@@ -2,11 +2,12 @@

set -euo pipefail

function installTravisTools {
function configureTravis {
mkdir -p ~/.local
curl -sSL https://github.com/SonarSource/travis-utils/tarball/v21 | tar zx --strip-components 1 -C ~/.local
curl -sSL https://github.com/SonarSource/travis-utils/tarball/v23 | tar zx --strip-components 1 -C ~/.local
source ~/.local/bin/install
}
configureTravis

function strongEcho {
echo ""
@@ -17,56 +18,52 @@ case "$TARGET" in

CI)
if [ "${TRAVIS_BRANCH}" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
strongEcho 'Build and analyze commit in master'
# this commit is master must be built and analyzed (with upload of report)
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent verify -Pcoverage-per-test -Dmaven.test.redirectTestOutputToFile=false -B -e -V
strongEcho 'Build, deploy and analyze master'

# Switch to java 8 as the Dory HTTPS certificate is not supported by Java 7
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export PATH=$JAVA_HOME/bin:$PATH
SONAR_PROJECT_VERSION=`maven_expression "project.version"`

# Do not deploy a SNAPSHOT version but the release version related to this build
set_maven_build_version $TRAVIS_BUILD_NUMBER

export MAVEN_OPTS="-Xmx1G -Xms128m"
mvn sonar:sonar -B -e -V \
-Dsonar.host.url=$SONAR_HOST_URL \
-Dsonar.login=$SONAR_TOKEN


elif [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ -n "$GITHUB_TOKEN" ]; then
# For security reasons environment variables are not available on the pull requests
# coming from outside repositories
# http://docs.travis-ci.com/user/pull-requests/#Security-Restrictions-when-testing-Pull-Requests
# That's why the analysis does not need to be executed if the variable SONAR_GITHUB_OAUTH is not defined.
strongEcho 'Build and analyze pull request'
# this pull request must be built and analyzed (without upload of report)
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent verify -Pcoverage-per-test -Dmaven.test.redirectTestOutputToFile=false -B -e -V
# Switch to java 8 as the Dory HTTPS certificate is not supported by Java 7
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export PATH=$JAVA_HOME/bin:$PATH
mvn sonar:sonar -B -e -V \
-Dsonar.analysis.mode=issues \
mvn org.jacoco:jacoco-maven-plugin:prepare-agent deploy sonar:sonar \
-Pcoverage-per-test,deploy-sonarsource \
-Dmaven.test.redirectTestOutputToFile=false \
-Dsonar.host.url=$SONAR_HOST_URL \
-Dsonar.login=$SONAR_TOKEN \
-Dsonar.projectVersion=$SONAR_PROJECT_VERSION \
-B -e -V

elif [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ -n "${GITHUB_TOKEN-}" ]; then
strongEcho 'Build and analyze pull request, no deploy'

# No need for Maven phase "install" as the generated JAR file does not need to be installed
# in Maven local repository. Phase "verify" is enough.

mvn org.jacoco:jacoco-maven-plugin:prepare-agent verify sonar:sonar \
-Dmaven.test.redirectTestOutputToFile=false \
-Dsonar.analysis.mode=issues \
-Dsonar.github.pullRequest=$TRAVIS_PULL_REQUEST \
-Dsonar.github.repository=$TRAVIS_REPO_SLUG \
-Dsonar.github.oauth=$GITHUB_TOKEN \
-Dsonar.host.url=$SONAR_HOST_URL \
-Dsonar.login=$SONAR_TOKEN
-Dsonar.login=$SONAR_TOKEN \
-B -e -V

else
strongEcho 'Build, no analysis'
# Build branch, without any analysis
strongEcho 'Build, no analysis, no deploy'

# No need for Maven goal "install" as the generated JAR file does not need to be installed
# in Maven local repository
mvn verify -Dmaven.test.redirectTestOutputToFile=false -B -e -V
# No need for Maven phase "install" as the generated JAR file does not need to be installed
# in Maven local repository. Phase "verify" is enough.

mvn verify \
-Dmaven.test.redirectTestOutputToFile=false \
-B -e -V
fi
;;

IT)
installTravisTools
if [ "${SQ_VERSION}" == "DEV" ]
if [ "${SQ_VERSION}" = "DEV" ]
then
build_snapshot "SonarSource/sonarqube"
fi
@@ -76,9 +73,7 @@ IT)
cd it
build_snapshot "SonarSource/orchestrator"
mvn -Dsonar.runtimeVersion="$SQ_VERSION" -Dmaven.test.redirectTestOutputToFile=false verify
mvn -Dsonar.runtimeVersion="$SQ_VERSION" -Dmaven.test.redirectTestOutputToFile=false verify -e -B -V
;;

*)

Loading…
Cancel
Save