forked from rednafi/fastapi-nano
-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.sh
executable file
·47 lines (35 loc) · 1.07 KB
/
script.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
#!/usr/bin/env bash
# Automatically update dependencies and run the tests.
# Assumes venv is activated.
# Turn on bash strict mode.
set -euxo pipefail
# Install cookiecutter.
pip install cookiecutter
# Create a concrete project from the cookiecutter template.
cookiecutter $(pwd) --no-input
# Install the dependencies.
cd fastapi-nano &&\
pip install -r requirements-dev.txt &&\
pip install -r requirements.txt &&\
cd ..
# Update the dependencies.
cd fastapi-nano && \
pip-compile --upgrade requirements-dev.txt && \
pip-compile --upgrade requirements.txt && \
cd ..
# Sync venv according to the upgraded dependencies.
cd fastapi-nano && \
pip-sync requirements-dev.txt requirements.txt &&
cd ..
# Run the tests.
pytest fastapi-nano
# Copy dependencies.
cp fastapi-nano/requirements.txt \{\{cookiecutter.repo\}\}/ && \
cp fastapi-nano/requirements-dev.txt \{\{cookiecutter.repo\}\}/
# Build docker-container.
cd fastapi-nano && docker-compose up --build -d && cd ..
# Cleanup.
cd fastapi-nano && docker-compose down && cd ..
# rm -rf fastapi-nano
# turn off command echo
set +x