forked from ThalesGroup/freyja
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·39 lines (30 loc) · 682 Bytes
/
build.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
#!/usr/bin/env bash
SCRIPT_PATH="$(realpath "$0")"
PROJECT_DIR="$(dirname "${SCRIPT_PATH:?}")"
#
# FUNCTIONS
#
function check_requirement(){
if ! eval "$@" >> /dev/null 2>&1 ; then
echo "! Fatal : missing requirement"
if [ -n "${*: -1}" ]; then echo "${@: -1}"; fi
exit 1
fi
}
#
# MAIN
#
check_requirement poetry --version "Install poetry first"
cd "${PROJECT_DIR}" || exit
echo "Build environment :"
poetry env info
echo ""
echo "Update dependencies"
poetry check
poetry update --without dev
poetry install --without dev --sync
echo "Build Freyja"
rm -rf "${PROJECT_DIR}/dist"
poetry build --format wheel
echo "Built in dist/:"
ls "./dist/"