Skip to content

Commit

Permalink
Merge pull request #67 from mekanix/feature/reggae
Browse files Browse the repository at this point in the history
Improve Reggae support
  • Loading branch information
mekanix authored Jun 16, 2020
2 parents 1a5c9b5 + 498c7e0 commit 1c54cff
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ test.db
vars.mk

dist/
freenit.egg-info/
*.egg-info/
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
.include <name.py>

USE_FREENIT = YES
SERVICE != echo ${app_name}
REGGAE_PATH := /usr/local/share/reggae

.include <${REGGAE_PATH}/mk/service.mk>

build_lib:
@sudo cbsd jexec jname=${SERVICE} user=devel cmd=/usr/src/bin/build.sh

publish: build_lib
@sudo cbsd jexec jname=${SERVICE} user=devel cmd=/usr/src/bin/publish.sh
3 changes: 2 additions & 1 deletion ansible/roles/devel/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
python_prefix: "py37-"
devel_packages:
- name: py37-sqlite3
- name: {{ python_prefix }}-sqlite3
18 changes: 0 additions & 18 deletions bin/freenit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,3 @@ mv project ${NAME}
echo "app_name=\"${NAME}\" # noqa: E225" >name.py
echo "ipdb" >requirements_dev.txt
echo "DEVEL_MODE = YES" >vars.mk
cat > Makefile << EOF
.include <name.py>
SERVICE != echo \${app_name}back
REGGAE_PATH := /usr/local/share/reggae
SYSPKG := YES
shell: up
@sudo cbsd jexec user=devel jname=\${SERVICE} /usr/src/bin/shell.sh
init: up
@sudo cbsd jexec jname=\${SERVICE} env OFFLINE=\${offline} SYSPKG=\${SYSPKG} /usr/src/bin/init.sh
do_devel:
@sudo cbsd jexec jname=\${SERVICE} env OFFLINE=\${offline} SYSPKG=\${SYSPKG} /usr/src/bin/devel.sh
.include <\${REGGAE_PATH}/mk/service.mk>
EOF
19 changes: 16 additions & 3 deletions freenit/project/.gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
*.egg-info/
.coverage
.pytest_cache
__pycache__
coverage.xml
database.db
local_config.py
test.db

# Reggae
.provisioned
ansible/group_vars/all
ansible/inventory/inventory
ansible/roles/*
ansible/site.yml
!ansible/roles/.keep
build/
cbsd.conf
site.retry
fstab
project.mk
site.retry
vars.mk

build/
cbsd.conf
dist/
8 changes: 8 additions & 0 deletions freenit/project/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.include <name.py>

SYSPKG := YES
USE_FREENIT = YES
SERVICE != echo \${app_name}back
REGGAE_PATH := /usr/local/share/reggae

.include <\${REGGAE_PATH}/mk/service.mk>
1 change: 1 addition & 0 deletions freenit/project/ansible/group_vars/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

File renamed without changes.
14 changes: 12 additions & 2 deletions freenit/project/bin/build.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
#!/bin/sh


BIN_DIR=`dirname $0`
set -e

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

flask collect --verbose

if [ "${OFFLINE}" != "yes" ]; then
pip install -U -r requirements_dev.txt
fi

cd ${PROJECT_ROOT}
rm -rf *.egg-info build dist
python setup.py sdist bdist_wheel
8 changes: 8 additions & 0 deletions freenit/project/bin/collect.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh


BIN_DIR=`dirname $0`
. ${BIN_DIR}/common.sh
setup

flask collect --verbose
2 changes: 1 addition & 1 deletion freenit/project/bin/uwsgi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export FLASK_ENV="production"

. ${BIN_DIR}/common.sh
setup
pip install -U uwsgi
pip install -U --upgrade-strategy eager uwsgi


cd ${PROJECT_ROOT}
Expand Down
2 changes: 1 addition & 1 deletion freenit/project/provisioners.mk
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.include <${REGGAE_PATH}/mk/shell.mk>
.include <${REGGAE_PATH}/mk/ansible.mk>
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
package_data={
'': [
'project/*',
'project/ansible/group_vars/*',
'project/ansible/inventory/*',
'project/ansible/roles/devel/*',
'project/bin/*',
'project/project/*',
'project/project/api/*',
Expand Down

0 comments on commit 1c54cff

Please sign in to comment.