|
|
|
@@ -1,4 +1,12 @@ |
|
|
|
#!/bin/sh |
|
|
|
#!/bin/bash |
|
|
|
|
|
|
|
usage () |
|
|
|
{ |
|
|
|
echo "USAGE: $0 [FLAGS]" |
|
|
|
echo "Flags:" |
|
|
|
echo " -t: Skip download of dependencies. Used for testing that a previous download succeded." |
|
|
|
echo " -h: Print this message" |
|
|
|
} |
|
|
|
|
|
|
|
is_reposilite_up () |
|
|
|
{ |
|
|
|
@@ -6,22 +14,58 @@ is_reposilite_up () |
|
|
|
return $? |
|
|
|
} |
|
|
|
|
|
|
|
i=0 |
|
|
|
until is_reposilite_up; do |
|
|
|
i=$((i+1)) |
|
|
|
wait_for_reposilite () |
|
|
|
{ |
|
|
|
i=0 |
|
|
|
until is_reposilite_up; do |
|
|
|
i=$((i+1)) |
|
|
|
|
|
|
|
if [ $i -gt 30 ]; then |
|
|
|
return $i |
|
|
|
fi |
|
|
|
|
|
|
|
if [ $i -gt 30 ]; then |
|
|
|
echo "Could not connect to reposilite. Aborting." |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
sleep 1 |
|
|
|
done |
|
|
|
|
|
|
|
return $i |
|
|
|
} |
|
|
|
|
|
|
|
should_download=1 |
|
|
|
|
|
|
|
sleep 1 |
|
|
|
while [ $# -ne 0 ]; do |
|
|
|
case "$1" in |
|
|
|
-t) should_download=0 ;; |
|
|
|
-h) usage; exit 0 ;; |
|
|
|
esac |
|
|
|
shift |
|
|
|
done |
|
|
|
|
|
|
|
handle_parameters |
|
|
|
wait_for_reposilite |
|
|
|
|
|
|
|
if [ $? -lt 30 ]; then |
|
|
|
for pom in /poms/*; do |
|
|
|
mvn -P central -Dos.detected.classifier=linux-x86_64 -f $pom dependency:go-offline; |
|
|
|
done |
|
|
|
if [ $should_download -eq 1 ]; then |
|
|
|
for pom in /poms/*; do |
|
|
|
mvn -P central \ |
|
|
|
-Dos.detected.classifier=linux-x86_64 \ |
|
|
|
-f $pom dependency:go-offline |
|
|
|
done |
|
|
|
fi |
|
|
|
|
|
|
|
echo "Generating quarkus project" |
|
|
|
mvn -P central \ |
|
|
|
io.quarkus.platform:quarkus-maven-plugin::create \ |
|
|
|
-DprojectGroupId=com.example \ |
|
|
|
-DprojectArtifactId=quarkus-test |
|
|
|
|
|
|
|
RET=$? |
|
|
|
if [ $RET -eq 0 ]; then |
|
|
|
cd quarkus-test |
|
|
|
echo "Building quarkus project" |
|
|
|
mvn package |
|
|
|
RET=$? |
|
|
|
fi |
|
|
|
exit $RET |
|
|
|
else |
|
|
|
echo "Can't connect to repository" |
|
|
|
exit 255 |
|
|
|
|