gvsig-gdal / trunk / org.gvsig.gdal2 / org.gvsig.gdal2.app / org.gvsig.gdal2.app.mainplugin / org.gvsig.gdal2.app.mainplugin.lin.x86_64 / src / main / assembly / pack.sh @ 369
History | View | Annotate | Download (1.91 KB)
1 |
#!/bin/bash |
---|---|
2 |
|
3 |
set -e |
4 |
|
5 |
if [ "$BASH" = "" ] ; then |
6 |
echo "Need a bash" |
7 |
exit 1 |
8 |
fi |
9 |
if ! type curl ; then |
10 |
echo "Need 'curl' command." |
11 |
exit 2 |
12 |
fi |
13 |
if ! type zenity ; then |
14 |
echo "Need 'zenity' command." |
15 |
exit 2 |
16 |
fi |
17 |
if ! type mvn ; then |
18 |
echo "Need 'mvn' command." |
19 |
exit 2 |
20 |
fi |
21 |
|
22 |
GVSIG_REPOSITORY="https://devel.gvsig.org/m2repo/j2se" |
23 |
|
24 |
do_login() { |
25 |
if [ -n "$USERNAME" -a -n "$PASSWORD" ] ; then |
26 |
return |
27 |
fi |
28 |
USERNAME=$(zenity --password --username) |
29 |
if [ -z "$USERNAME" ] ; then |
30 |
exit 0 |
31 |
fi |
32 |
PASSWORD="${USERNAME/*|/}" |
33 |
USERNAME="${USERNAME/|*/}" |
34 |
} |
35 |
|
36 |
do_deploy() { |
37 |
echo "Deploy" |
38 |
|
39 |
do_login |
40 |
|
41 |
curl -sf --insecure --user "${USERNAME}:${PASSWORD}" -X MKCOL "${GVSIG_REPOSITORY}/${gdal_groupId/./\/}/${gdal_artifactId}/${gdal_version}" >/dev/null |
42 |
if [ "$?" != "0" -a "$?" != "22" ] ; then |
43 |
echo "Can't access to the repository for write." |
44 |
exit 1 |
45 |
fi |
46 |
|
47 |
mvn deploy:deploy-file \ |
48 |
-Durl=https://devel.gvsig.org/m2repo/j2se \ |
49 |
-DrepositoryId=gvsig-repository \ |
50 |
-DgroupId="${gdal_groupId}" \ |
51 |
-DartifactId="${gdal_artifactId}" \ |
52 |
-Dversion="${gdal_version}" \ |
53 |
-Dpackaging=jar \ |
54 |
-Dfile="${gdal_jar}" \ |
55 |
-Ddescription="Binarios de GDAL." |
56 |
|
57 |
mvn deploy:deploy-file \ |
58 |
-Durl=https://devel.gvsig.org/m2repo/j2se \ |
59 |
-DrepositoryId=gvsig-repository \ |
60 |
-DgroupId="${gdal_groupId}" \ |
61 |
-DartifactId="${gdal_artifactId}" \ |
62 |
-Dversion="${gdal_version}" \ |
63 |
-Dpackaging=tar.gz \ |
64 |
-Dclassifier="${gdal_classifier}" \ |
65 |
-Dfile="../gdal-${gdal_version}-${gdal_classifier}.tar.gz" \ |
66 |
-Ddescription="Binarios de GDAL." |
67 |
|
68 |
} |
69 |
|
70 |
|
71 |
do_package() { |
72 |
echo "Package" |
73 |
rm -f "../gdal-${gdal_version}-${gdal_classifier}.tar.gz" |
74 |
tar zcvf "../gdal-${gdal_version}-${gdal_classifier}.tar.gz" . |
75 |
} |
76 |
|
77 |
|
78 |
do_main() { |
79 |
cd $(dirname $0) |
80 |
|
81 |
. ./pack.cfg |
82 |
|
83 |
case "$1" in |
84 |
deploy) |
85 |
do_deploy |
86 |
;; |
87 |
package) |
88 |
do_package |
89 |
;; |
90 |
all) |
91 |
do_package |
92 |
do_deploy |
93 |
;; |
94 |
esac |
95 |
} |
96 |
|
97 |
|
98 |
do_main $@ |
99 |
|
100 |
|
101 |
|