Skip to content

Commit

Permalink
Adopt to newer reggae
Browse files Browse the repository at this point in the history
  • Loading branch information
mekanix committed Jul 27, 2021
1 parent e9d586c commit 2b5b50f
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 29 deletions.
4 changes: 1 addition & 3 deletions bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

BIN_DIR=`dirname $0`
PROJECT_DIR="${BIN_DIR}"
export FREENIT_ENV="build"
. ${BIN_DIR}/common.sh


setup no
pip install -U pip
pip install -U wheel
pip install -U --upgrade-strategy eager -e ".[build]"


rm -rf *.egg-info build dist
Expand Down
11 changes: 10 additions & 1 deletion bin/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,20 @@ setup() {
fi
. ${HOME}/.virtualenvs/${VIRTUALENV}/bin/activate

INSTALL_TARGET=".[${FREENIT_ENV}]"
if [ "${FREENIT_ENV}" = "prod" ]; then
INSTALL_TARGET="."
fi
cd ${PROJECT_ROOT}
if [ "${update}" != "no" ]; then
pip install -U pip
pip install -U wheel
pip install -U --upgrade-strategy eager -e .
pip install -U --upgrade-strategy eager -e "${INSTALL_TARGET}"
fi
fi
if [ ! -e "alembic/versions" ]; then
mkdir alembic/versions
alembic revision --autogenerate -m initial
fi
alembic upgrade head
}
8 changes: 1 addition & 7 deletions bin/devel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@ export OFFLINE=${OFFLINE:="no"}


. ${BIN_DIR}/common.sh
setup no

if [ ! -e "alembic/versions" ]; then
mkdir alembic/versions
alembic revision --autogenerate -m initial
alembic upgrade head
fi
setup

echo "Backend"
echo "==============="
Expand Down
20 changes: 19 additions & 1 deletion bin/freenit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ echo "- onelove-roles.freebsd_freenit" >>requirements.yml
echo "- onelove-roles.freebsd_freenit_sql" >>requirements.yml


cat > Makefile << EOF
cat >Makefile<< EOF
.include <name.py>
USE_FREENIT = YES
Expand Down Expand Up @@ -75,5 +75,23 @@ dist/
*.egg-info/
EOF

cat >alembic/env.py<<EOF
import os
import sys
import ${NAME}.app
from alembic import context
from freenit.migration import run_migrations_offline, run_migrations_online
sys.path.append(os.getcwd())
if context.is_offline_mode():
run_migrations_offline()
else:
run_migrations_online()
EOF


echo "Success! Please edit setup.py!"
10 changes: 1 addition & 9 deletions bin/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,4 @@ BIN_DIR=`dirname $0`
. ${BIN_DIR}/common.sh


if [ "${OFFLINE}" = "yes" ]; then
setup no
else
setup
fi

# if [ -e "alembic/versions" ]; then
# alembic upgrade head
# fi
setup
3 changes: 2 additions & 1 deletion bin/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ set -e

export BIN_DIR=`dirname $0`
export PROJECT_ROOT="${BIN_DIR}/.."
export FREENIT_ENV="build"
. ${BIN_DIR}/common.sh
setup no
setup


twine upload dist/freenit-* --verbose
6 changes: 1 addition & 5 deletions bin/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,5 @@ export FREENIT_ENV="test"
. ${BIN_DIR}/common.sh


setup no
pip install -U pip
pip install -U wheel
pip install -U --upgrade-strategy eager -e ".[test]"

setup
pytest -v
2 changes: 1 addition & 1 deletion freenit/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@

def getConfig():
config_name = os.getenv("FREENIT_ENV", "prod")
return configs[config_name]
return configs.get(config_name, configs["prod"])
2 changes: 1 addition & 1 deletion freenit/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "0.2.0"
version = "0.2.1"

0 comments on commit 2b5b50f

Please sign in to comment.