You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2015/06/21 15:13:58 UTC

[02/24] git commit: updated refs/heads/master to 6fd49e4

This is a quick fix to attempt to resolve most of the travis failures Most of the failures have been due to transient network failures, that are causing dependency artifact downloads to fail Maven does not have a way to retry this without restarting the whole build, so the mvn dependency plugin is the best bet Unfortunately, running a dependency:resolve on the project returns yet to be compiled dependencies, and causes it to fail... There is an option to excludeGroupIds and excludeArtifactIds in the docs for this goal, but unfortunately they don't seem to work This drafts a dummy pom in a quick and dirty way, just to download all the deps in one go, while retrying for RETRY_COUNT times if it fails

Signed-off-by: Daan Hoogland <da...@onecht.net>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/880f116a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/880f116a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/880f116a

Branch: refs/heads/master
Commit: 880f116a629c7f00af3ad4af331924edeb585047
Parents: bbb165a
Author: Rafael da Fonseca <rs...@gmail.com>
Authored: Thu Jun 18 22:04:51 2015 +0200
Committer: Daan Hoogland <da...@onecht.net>
Committed: Sun Jun 21 15:13:24 2015 +0200

----------------------------------------------------------------------
 tools/travis/before_install.sh | 25 +++++++++++++++++++++
 tools/travis/downloadDeps.sh   | 43 +++++++++++++++++++++++++++++++++++++
 2 files changed, 68 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/880f116a/tools/travis/before_install.sh
----------------------------------------------------------------------
diff --git a/tools/travis/before_install.sh b/tools/travis/before_install.sh
index 31efc65..dd90ec6 100755
--- a/tools/travis/before_install.sh
+++ b/tools/travis/before_install.sh
@@ -84,3 +84,28 @@ echo -e "\nInstalling some python packages: "
 
 sudo pip install lxml > /dev/null
 sudo pip install texttable > /dev/null
+
+#Download project dependencies in a way we can retry if there's a failure, without failing the whole build
+RETRY_COUNT=3
+
+#Resolve plugins first
+for ((i=0;i<$RETRY_COUNT;i++))
+do
+ mvn org.apache.maven.plugins:maven-dependency-plugin:resolve-plugins
+ if [[ $? -eq 0 ]]; then
+   break;
+ fi
+done
+
+#Resolve remaining deps
+cd tools/travis
+./downloadDeps.sh 2> /dev/null
+
+for ((i=0;i<$RETRY_COUNT;i++))
+do
+ mvn org.apache.maven.plugins:maven-dependency-plugin:resolve
+ if [[ $? -eq 0 ]]; then
+   break;
+ fi
+done
+cd ../..

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/880f116a/tools/travis/downloadDeps.sh
----------------------------------------------------------------------
diff --git a/tools/travis/downloadDeps.sh b/tools/travis/downloadDeps.sh
new file mode 100755
index 0000000..29248e0
--- /dev/null
+++ b/tools/travis/downloadDeps.sh
@@ -0,0 +1,43 @@
+#Create dummy pom
+echo '<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>org.apache.cloudstack</groupId><artifactId>travis-build-deps</artifactId><name>Download Deps for Travis CI</name><version>1</version><dependencies>' > pom.xml
+
+#Get all dependency blocks
+for line in $(find . -name pom.xml -exec sed -n '/<dependencies>/{:a;n;/<\/dependencies>/b;p;ba}' {} \; | grep -e "artifactId" -e "groupId" -e "version" -e "dependency\>" -e "exclusion\>" -e "exclusions\>"); do
+
+  #Tokenize values
+  set -- $(echo $line | awk -v FS="(>|<)" '{print $2, $3}')
+
+  #Start processing data
+
+  if [ $1 == "dependency" ]; then
+    #Create new artifact dep
+    ARTIFACT=$line
+  elif [ $1 == "/dependency" ]; then
+    #Filter out project modules interdependencies and noredist artifacts
+    if [[ $ARTIFACT != *org.apache.cloudstack* ]] && [[ $ARTIFACT != *com.cloud* ]] && [[ $ARTIFACT != *org.midonet* ]] && [[ $ARTIFACT != *net.juniper* ]] ; then
+	echo $ARTIFACT$line >> pom.xml
+    fi
+  elif [ $1 == "version" ]; then
+    #If version is a maven var, get the value from parent pom
+    if [[ $2 == \$\{* ]]; then
+
+      VER=$(grep \<$(echo $2 | awk -v FS="(}|{)" '{print $2 }') ../../pom.xml | awk -v FS="(>|<)" '{print $3}')
+      if [[ "$VER" == "" ]]; then
+        ARTIFACT=org.apache.cloudstack
+      else
+        ARTIFACT="$ARTIFACT<version>$VER</version>"
+      fi
+    elif [[ "$2" == "" ]]; then
+      ARTIFACT="$ARTIFACT<version>LATEST</version>"
+    else
+      ARTIFACT=$ARTIFACT$line
+    fi
+  else
+    ARTIFACT=$ARTIFACT$line
+  fi
+
+done
+
+
+#Finish dummy pom
+echo "</dependencies></project>" >> pom.xml