-
Notifications
You must be signed in to change notification settings - Fork 6
/
deploy.sh
executable file
·68 lines (43 loc) · 1.35 KB
/
deploy.sh
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
#!/bin/bash
set -e
# auteur : Régis Haubourg - GrenobleAlpesMetropole
# Licence GPLV3
# 26/05/2021
# this script takes your locally built tar.bz2 package and push it to the local repository hosting your osgeo4W binaries
echo "** Deploying osgeo4W custom package **
"
cd qgis-custom
SETUP_TEXT=$(cat setup.hint)
PACKAGE_DIR="/x/OSGEO4W_DEPLOY_TEST/PAQUETS/http%3a%2f%2fwww.norbit.de%2fosgeo4w%2f"
echo "-Target package directory :
$PACKAGE_DIR
"
echo "-PAckage metadata :
------------
$SETUP_TEXT
------------"
if [ ! -d "$PACKAGE_DIR" ]
then
echo "Target directory doesn't exists"
# e xit 2
fi
VERSION=$(grep -i version setup.hint | awk '{printf $2}')
echo "package version found: $VERSION"
mkdir -p "$PACKAGE_DIR/x86_64/release/qgis/qgis-custom/"
cd -
cp -p qgis-custom-$VERSION.tar.bz2 $PACKAGE_DIR/x86_64/release/qgis/qgis-custom/
# md5 and size
MD5=$(md5sum qgis-custom-$VERSION.tar.bz2 | awk -F'[ ]' '{print $1}')
size=$(stat -c "%s" qgis-custom-$VERSION.tar.bz2)
# adds metadata into setup.ini, from setup.hint template
echo -e "
- Modification du setup.ini cible"
# deletes previous entry
sed -i '/@ qgis-custom/,+8d;' $PACKAGE_DIR/x86_64/setup.ini
# append to the end of the file
echo "@ qgis-custom
$SETUP_TEXT $size $MD5
" >> $PACKAGE_DIR/x86_64/setup.ini
echo -e "--------"
echo -e "** Package deployed **"
echo -e "--------"