diff --git a/Taskfile b/Taskfile new file mode 100755 index 0000000..c9e2ef7 --- /dev/null +++ b/Taskfile @@ -0,0 +1,55 @@ +#!/bin/bash + +function test { + if [ `uname` = "Darwin" ] + then + echo "installing dependncies for MacOS" + # check if has brew + brew install redis-cli + else + echo "installing dependencies for Debian like" + apt-get install redis-server + fi + + echo "Configuring user in redis to test" + redis-cli SET "ADMIN" "xyz" + + echo "running test" + py.test -s -v --cov=./ --cov-report term-missing -v +} + + +function install { + echo "install task not implemented" +} + +function build { + echo "build task not implemented" +} + + +function start { + rm -vrf ./build ./dist ./*.pyc ./*.tgz ./*.egg-info ./out ./*/out ./.mypy_cache ./*/.mypy_cache */.pytest_cache .pytest_cache .serverless/* + echo "starting ..." + + docker-compose -f platform/docker/docker-compose.yml up + uvicorn brandenburg.main:app --log-level trace --reload + +} + +function stop { + docker-compose -f platform/docker/docker-compose.yml down +} + +function default { + start +} + +function help { + echo "$0 " + echo "Tasks:" + echo "$0 start -> Para iniciar o ..." +} + +TIMEFORMAT="Task completed in %3lR" +time ${@:-default} diff --git a/scripts/README.md b/scripts/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/scripts/bootstrap b/scripts/bootstrap deleted file mode 100755 index ac62b29..0000000 --- a/scripts/bootstrap +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -source script/setup - -echo "Removing uneeded files" -rm -vrf ./build ./dist ./*.pyc ./*.tgz ./*.egg-info ./out ./*/out ./.mypy_cache ./*/.mypy_cache */.pytest_cache .pytest_cache .serverless/* - -echo "Installing dependencies" -pipenv install --dev -pipenv install - diff --git a/scripts/console b/scripts/console deleted file mode 100755 index 1a24852..0000000 --- a/scripts/console +++ /dev/null @@ -1 +0,0 @@ -#!/bin/sh diff --git a/scripts/server b/scripts/server deleted file mode 100755 index 2fc1aa4..0000000 --- a/scripts/server +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -# source script/bootstrap -docker-compose up -d - -uvicorn brandenburg.main:app --log-level trace --reload diff --git a/scripts/setup b/scripts/setup deleted file mode 100755 index 282b80e..0000000 --- a/scripts/setup +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -echo "Checking system depencies such as pip and pipenv" -if [[ `which pip3` = "pip3 not found" ]] -then - curl https://bootstrap.pypa.io/get-pip.py | python -fi - -if [[ `which pipenv` = "pipenv not found" ]] -then - curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python -fi -if [[ `which docker-compose` = "docker-compose not found" ]] -then - pip install docker-compose -fi - diff --git a/scripts/test b/scripts/test deleted file mode 100755 index 319389b..0000000 --- a/scripts/test +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - - -if [ `uname` = "Darwin" ] -then - echo "installing dependncies for MacOS" - # check if has brew - brew install redis-cli -else - echo "installing dependencies for Debian like" - apt-get install redis-server -fi - -echo "Configuring user in redis to test" -redis-cli SET "ADMIN" "xyz" - -echo "running test" -py.test -s -v --cov=./ --cov-report term-missing -v