Skip to content

Commit 6fd49e4

Browse files
rsafonsecaDaanHoogland
authored andcommitted
Add apache license header to script
Signed-off-by: Daan Hoogland <daan@onecht.net> This closes apache#482
1 parent 4f098a1 commit 6fd49e4

2 files changed

Lines changed: 28 additions & 2 deletions

File tree

‎tools/travis/before_install.sh‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ done
9797
echo -e "\nDownloading Plugin dependencies"
9898
for ((i=0;i<$RETRY_COUNT;i++))
9999
do
100+
#The output file is used on the next phase by the downloadDeps.sh script
100101
mvn org.apache.maven.plugins:maven-dependency-plugin:resolve-plugins | grep "Plugin Resolved:" | sort -u | awk '{print $4}' | tee /tmp/resolvedPlugins
101102
if [[ $? -eq 0 ]]; then
102103
echo -e "\nPlugin dependencies downloaded successfully"
@@ -120,9 +121,11 @@ do
120121
break;
121122
fi
122123
echo -e "\nDependency download failed"
124+
#Print out errors from failed run
123125
cat /tmp/phase2 | grep -i -e "fail" -e "error" -e "exception"
124126
#Test DNS record
125127
getent hosts repo1.maven.org
126128
while ! nc -vzw 5 repo1.maven.org 80; do echo -e "\nFailed to connect to repo1.maven.org:80 will retry in 10 seconds"; sleep 10; done
129+
echo -e "\nRetrying download"
127130
done
128131
cd ../..

‎tools/travis/downloadDeps.sh‎

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
11
#!/bin/bash
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
# This script should be used to install additional dependencies
20+
# This includes: installing ubuntu packages, custom services
21+
# or internet downloads.
22+
23+
# Authored by Rafael da Fonseca <rsafonseca@gmail.com>
224

325
#Get all dependency blocks from all pom.xml files in the project
426
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\>"| sed -e 's/\^M//'); do
@@ -7,7 +29,6 @@ for line in $(find ../../ -name pom.xml -exec sed -n '/<dependencies>/{:a;n;/<\/
729
set -- $(echo $line | awk -v FS="(>|<)" '{print $2, $3}')
830

931
#Start processing data
10-
1132
if [[ $1 == "dependency" ]]; then
1233
#Create new artifact dep
1334
unset ARTIFACT
@@ -18,10 +39,12 @@ for line in $(find ../../ -name pom.xml -exec sed -n '/<dependencies>/{:a;n;/<\/
1839
if [[ $GROUP != *org.apache.cloudstack* ]] && [[ $GROUP != *com.cloud* ]] && [[ $ARTIFACT != cloudstack-service-console-proxy-rdpclient ]]; then
1940
if [[ -z $VERSION ]] ; then
2041
VERSION=LATEST
42+
#These dependencies don't support the LATEST keywork for some reason, and would cause mvn runs to file on dummy poms
2143
if [[ $GROUP == jstl ]] || [[ $ARTIFACT == mysql-connector-java ]] || [[ $GROUP == org.apache.axis ]]; then
2244
continue
2345
fi
2446
fi
47+
#Output resolved dependency to a file, to be picked up later
2548
echo "$GROUP $ARTIFACT $VERSION" >> deps.out
2649
fi
2750
elif [[ $1 == "version" ]]; then
@@ -89,7 +112,6 @@ do
89112
if [[ $? -ne 0 ]]; then
90113
RETURN_CODE=1
91114
fi
92-
93115
done
94116

95117
#Run a few plugin goals to download some more deps
@@ -113,6 +135,7 @@ do
113135
done < <(grep $PLUGIN cleandeps.out)
114136
done
115137
echo "Running $JOBS"
138+
#Call all the constructed plugin goals
116139
mvn $JOBS -f pom0.xml
117140
if [[ $? -ne 0 ]]; then
118141
RETURN_CODE=1

0 commit comments

Comments
 (0)