forked from SignalOceanSdk/SignalSDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-docker.sh
65 lines (53 loc) · 1.19 KB
/
build-docker.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
#!/bin/bash -e
set -euxo pipefail
while [[ "$#" -gt 0 ]]
do
case $1 in
--repository-url)
repository_url="$2"
shift 2
;;
--username)
username="$2"
shift 2
;;
--password)
password="$2"
shift 2
;;
*)
shift
;;
esac
done
echo 'Upgrading pip...'
python3.8 -m pip install --upgrade pip
echo 'Installing dependencies...'
pip install -r ./requirements.txt
echo 'Running type checks...'
mypy --strict --implicit-reexport signal_ocean
echo 'Running code analysis...'
flake8 signal_ocean
echo 'Running tests...'
pytest
echo 'Analyzing docstrings...'
pydocstyle --match='(?!_[^_]).*\.py' --convention=google signal_ocean
echo 'Building dist...'
rm -rf dist/*
python3.8 ./setup.py sdist bdist_wheel
if [[ ! $repository_url ]]
then
echo 'Repository URL was not provided.'
exit 1
fi
if [[ ! $username ]]
then
echo 'Username was not provided.'
exit 1
fi
if [[ ! $password ]]
then
echo 'Password was not provided.'
exit 1
fi
twine upload --skip-existing --repository-url "$repository_url" -u "$username" -p "$password" ./dist/*