-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
do_release.sh
37 lines (30 loc) · 1.12 KB
/
do_release.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
#!/usr/bin/env bash
# This is a script for doing a SIMPLE release
# How to run: do_release.sh DICT_VERSION /path/to/directory/with/raw/dictionaries aws_profile aws_mfa_uid
# You also need to have prepared python virtual environment with dependencies
# See RELEASE.md for details
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
DICT_VERSION=$1
RAW_DIC_PATH=$2
AWS_PROFILE=$3
AWS_MFA_ID=$4
if [ -z "$5" ]; then
PY_PACKAGE_VERSION=${DICT_VERSION}
else
PY_PACKAGE_VERSION=$5
fi
# upload dictionary csvs to s3
python3 "$SCRIPT_DIR/scripts/01_upload_raw_dictionaries.py" \
--input="$RAW_DIC_PATH" \
--version="$DICT_VERSION" \
--aws_profile="$AWS_PROFILE" \
--aws_mfa="$AWS_MFA_ID"
# build binary dictionaries
"$SCRIPT_DIR/gradlew" -Pdict.release=true -Pdict.version="$DICT_VERSION" build
# upload binary dictionaries to s3
python3 "$SCRIPT_DIR/scripts/02_upload_compiled_dictionaries.py" \
--input="$SCRIPT_DIR/build/distributions" \
--aws_profile="$AWS_PROFILE" \
--aws_mfa="$AWS_MFA_ID"
# build python distributions
bash $SCRIPT_DIR/package_python.sh "$DICT_VERSION" "$PY_PACKAGE_VERSION"