/
magic_upload_files.sh
executable file
·73 lines (57 loc) · 1.95 KB
/
magic_upload_files.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
69
70
71
72
73
#!/bin/bash
# set -u
set -e
set -x
source cliqz_env.sh
cd $SRC_BASE
cd $OBJ_DIR
echo '***** Generate MAR for DE, if needed *****'
if [ "$CQZ_BUILD_DE_LOCALIZATION" == "1" ]; then
$MAKE -C ./tools/update-packaging full-update AB_CD=de \
PACKAGE_BASE_DIR=`pwd`/dist/l10n-stage
fi
echo '***** Packaging MAR *****'
$MAKE update-packaging
if [ $CQZ_CERT_DB_PATH ]; then
# TODO: Specify certificate name by env var.
if [ -z "$MAR_CERT_NAME" ]; then
MAR_CERT_NAME="Release Cliqz MAR signing key"
fi
echo '***** Signing mar *****'
MAR_FILES=dist/update/*.mar
for MAR_FILE in $MAR_FILES
do
# signmar is somehow dependent on its execution path. It refuses to work when
# launched using relative paths, and gives unrelated error:
# "Could not initialize NSS". BEWARE!
SIGNMAR_ABS_DIR=$(cd dist/bin/; pwd)
$SIGNMAR_ABS_DIR/signmar -d $CQZ_CERT_DB_PATH -n "$MAR_CERT_NAME" \
-s $MAR_FILE $MAR_FILE.signed
mv $MAR_FILE $MAR_FILE.unsigned
cp $MAR_FILE.signed $MAR_FILE
done
fi
echo '***** Uploading MAR and package files *****'
export LANG=$LANG
$MAKE upload
echo '***** Genereting build_properties.json *****'
$ROOT_PATH/$SRC_BASE/build/gen_build_properties.py
if [ "$CQZ_BUILD_DE_LOCALIZATION" == "1" ]; then
# Rename build_properties so name wont collide with repack
cp build_properties.json en_build_properties.json
OLD_LANG=$LANG
export LANG='de'
# We need to copy this files because we build DE version as repack step, so
# they don't exist for DE build (but must be before uploading stage, so they)
# fall into mach_build_properties.json file
for f in dist/cliqz-*.{txt,json}; do
cp $f `echo $f | sed "s/en-US/$LANG/"`
done
$MAKE upload AB_CD=$LANG
echo '***** Genereting build_properties.json *****'
$ROOT_PATH/$SRC_BASE/build/gen_build_properties.py
# Rename de build_properties for easier identification
cp build_properties.json de_build_properties.json
export LANG=$OLD_LANG
fi
cd $ROOT_PATH