Skip to content

Commit f531ae9

Browse files
committed
feat: starts work on reject feature REFS #55
1 parent 3f40fb4 commit f531ae9

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Taskfile.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ tasks:
99
- docker build -t anomalyhq/python-lab-server-api:v{{.PROJ_VER}} -f Dockerfile.api .
1010
dev:test:
1111
desc: runs tests inside the server container
12+
summary: |
13+
Uses pytest to run a set of extensive test suites for the project
1214
cmds:
1315
- docker compose exec api sh -c "pytest"
1416
dev:pyshell:
@@ -43,3 +45,18 @@ tasks:
4345
desc: migrates models to HEAD
4446
cmds:
4547
- docker compose exec api sh -c "alembic -c /opt/$PROJ_NAME/alembic.ini upgrade head"
48+
eject:
49+
desc: eject the project from a template
50+
summary: |
51+
This process will remove any references to the Anomaly labs template,
52+
it specifically will set the package name to your project name, fix
53+
any references in configuration files to the labs project.
54+
55+
Finally it will remove references to all alembic migrations
56+
57+
Ejecting the template should only ever be done once!
58+
cmds:
59+
- rm src/labs/alembic/versions/*.py
60+
- FROM="labs"; TO=$PROJ_NAME; for FROM_DIR in `find . -name $FROM`; do if [ -d $FROM_DIR ]; then TARGET_DIR=`echo $FROM_DIR | sed "s/$FROM/$TO/g"`; echo $FROM_DIR ">" $TARGET_DIR; mv $FROM_DIR $TARGET_DIR; fi ; done; for SRC_FILE in `ls **/*.py **/Makefile **/*.yml **/Dockerfile **/*.dockerfile **/alembic.ini **/.env* **/README.md `; do sed -i '' "s/$FROM/$TO/g" $SRC_FILE; done
61+
status:
62+
- test $PROJ_NAME != "labs"

0 commit comments

Comments
 (0)