-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetbuilds
executable file
·80 lines (69 loc) · 1.76 KB
/
getbuilds
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
# Script activity switches
uncompress=false
delete=true
verbose=false
build_type=snapshot
base=~/versions
z='-'
################################
# Version numbers and products to download
################################
versions=( "6.1.0.0" )
products=( "ds" "proxy" "sync" "metrics" "broker" "ldapsdk" "server-sdk" "ssam" )
################################
# Get the products for a version
################################
function getProducts ()
{
version=$1
# the getbuild.py utility must run within a directory
cd $base/$version
# For this version, get the products
echo "Getting builds for $version"
for product in ${products[*]}
do
printf "%0.s#" {1..10}
echo ""
echo " $z $product"
getbuild.py $build_type $product $version
# Determine if files should be uncompressed or not
if [ "$uncompress" = true ]; then
echo " $z Uncompressing files."
unzip -oq '*.zip'
fi
echo "$version : $product complete."
terminal-notifier -title 'Getbuilds' -message "Completed $version $product"
done
}
################################
# Main
################################
# Make the base if it doesn't already exist
if [ ! -d "$base" ]
then
echo "$z The directory $base does not exist."
echo "$z Creating $base"
mkdir -p $base
fi
# For each version in the versions list get the products
for v in ${versions[*]}
do
# Delete old files before retrieving more
if [ "$delete" = true ]; then
rm -rf $base/$v
#rm -rf $base/$v/*.zip
fi
# Make the version directory if it doesnt exist already
if [ ! -d "$base/$v" ]
then
mkdir -p $base/$v
fi
# Get all the products for the version
if [ "$verbose" = true ]; then
getProducts $v &
else
( getProducts $v & ) >> /dev/null 2>&1 &
fi
done
wait