]> source.dussan.org Git - sonarqube.git/commitdiff
BUILD-753 Migrate IRIS task to Travis
authorWouter Admiraal <wouter.admiraal@sonarsource.com>
Mon, 24 Feb 2020 11:32:04 +0000 (12:32 +0100)
committerSonarTech <sonartech@sonarsource.com>
Wed, 26 Feb 2020 09:41:19 +0000 (10:41 +0100)
.travis/run_iris.sh [new file with mode: 0755]
travis.sh

diff --git a/.travis/run_iris.sh b/.travis/run_iris.sh
new file mode 100755 (executable)
index 0000000..638cefc
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+set +x
+
+VERSION="\[RELEASE\]"
+HTTP_CODE=`curl  --write-out %{http_code} -O --user $ARTIFACTORY_PRIVATE_USERNAME:$ARTIFACTORY_API_KEY $ARTIFACTORY_URL/sonarsource-private-releases/com/sonarsource/iris/iris/$VERSION/iris-$VERSION-jar-with-dependencies.jar`
+
+if [ "$HTTP_CODE" != "200" ]; then
+  echo "Download $VERSION failed -> $HTTP_CODE"
+  exit -1
+else
+  echo "Downloaded $VERSION"
+fi
+
+java -Diris.projectKey=org.sonarsource.sonarqube:sonarqube \
+  -Diris.source.url=https://next.sonarqube.com/sonarqube \
+  -Diris.source.token=$NEXT_TOKEN \
+  -Diris.destination.url=$SONAR_HOST_URL \
+  -Diris.destination.token=$SONAR_TOKEN \
+  -Diris.maxcountposts=50 \
+  -jar iris-[RELEASE]-jar-with-dependencies.jar
index b2f4e883651760f521d92e6c7c532f0db4bfed1e..2f443dcafac11df93c60182da073e51475b79616 100755 (executable)
--- a/travis.sh
+++ b/travis.sh
@@ -46,6 +46,10 @@ BUILD)
       -Dsonar.organization=sonarsource \
       -Dsonar.host.url=https://sonarcloud.io \
       -Dsonar.login="$SONAR_TOKEN"
+    
+    # Wait for 5mins, hopefully the report will be processed.
+    sleep 5m
+    ./.travis/run_iris.sh
   fi
   ;;