mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
chore: (task|make)file templates
This commit is contained in:
@@ -85,6 +85,7 @@ task --completion 'bash' > '/etc/bash_completion.d/task'
|
||||
|
||||
- [Website]
|
||||
- [Github]
|
||||
- [Demystification of taskfile variables]
|
||||
|
||||
### Sources
|
||||
|
||||
@@ -109,4 +110,5 @@ task --completion 'bash' > '/etc/bash_completion.d/task'
|
||||
[website]: https://taskfile.dev/
|
||||
|
||||
<!-- Others -->
|
||||
[demystification of taskfile variables]: https://medium.com/@TianchenW/demystification-of-taskfile-variables-29b751950393
|
||||
[stop using makefile (use taskfile instead)]: https://dev.to/calvinmclean/stop-using-makefile-use-taskfile-instead-4hm9
|
||||
|
||||
11
templates/Makefile
Normal file
11
templates/Makefile
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env make
|
||||
|
||||
include .env
|
||||
-include .env.local
|
||||
|
||||
export
|
||||
|
||||
REPOSITORY_ROOT = ${shell git rev-parse --show-toplevel}
|
||||
|
||||
debug-env:
|
||||
@set | sort
|
||||
39
templates/Taskfile.yml
Normal file
39
templates/Taskfile.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
version: '3'
|
||||
|
||||
set:
|
||||
- errexit # -e
|
||||
- pipefail # -o pipefail
|
||||
|
||||
vars:
|
||||
VENV_DIR: '{{.ROOT_TASKFILE}}/.venv'
|
||||
|
||||
tasks:
|
||||
|
||||
dev-tools:bootstrap:
|
||||
cmds:
|
||||
- task: python:venv:create
|
||||
- npm install
|
||||
|
||||
dev-tools:update:
|
||||
cmds:
|
||||
- task: python:update-venv
|
||||
- npm update --save
|
||||
|
||||
python:venv:create:
|
||||
vars:
|
||||
PYTHON_VERSION: '{{.PYTHON_VERSION | default 3.12}}'
|
||||
REQUIREMENTS_FILE: '{{.ROOT_TASKFILE}}/requirements.txt'
|
||||
cmds:
|
||||
- python{{.PYTHON_VERSION}} -m 'venv' '{{.VENV_DIR}}'
|
||||
- "{{.VENV_DIR}}/bin/pip --require-virtualenv install -r '{{.REQUIREMENTS_FILE}}'"
|
||||
|
||||
python:venv:recreate:
|
||||
cmds:
|
||||
- rm -rf '{{.VENV_DIR}}'
|
||||
- task: python:venv:create
|
||||
|
||||
python:venv:update:
|
||||
cmd: >-
|
||||
{{.VENV_DIR}}/bin/pip freeze -l --require-virtualenv | sed 's/==/>=/'
|
||||
| xargs {{.VENV_DIR}}/bin/pip --require-virtualenv install -U
|
||||
Reference in New Issue
Block a user