Initial template
This commit is contained in:
@@ -0,0 +1 @@
|
||||
COMPOSE_ENV=local
|
||||
@@ -0,0 +1,6 @@
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
docker-compose.override.yml
|
||||
.DS_Store
|
||||
.idea
|
||||
@@ -0,0 +1,16 @@
|
||||
repos:
|
||||
- repo: local
|
||||
hooks:{% if not parts %} []{% endif %}
|
||||
{% for part in parts %} - id: {{ part }}-fmt
|
||||
name: {{ part }} fmt
|
||||
entry: make -C {{ part }} fmt
|
||||
language: system
|
||||
files: ^{{ part }}/
|
||||
pass_filenames: false
|
||||
- id: {{ part }}-check
|
||||
name: {{ part }} check
|
||||
entry: make -C {{ part }} check
|
||||
language: system
|
||||
files: ^{{ part }}/
|
||||
pass_filenames: false
|
||||
{% endfor %}
|
||||
@@ -0,0 +1,16 @@
|
||||
## Code Principles
|
||||
- **Simplicity**: Write simple, straightforward code
|
||||
- **Readability**: Make code easy to understand
|
||||
- **Performance**: Consider performance without sacrificing readability
|
||||
- **Maintainability**: Write code that's easy to update
|
||||
- **Reusability**: Create reusable components and functions
|
||||
- **Less Code = Less Debt**: Minimize code footprint
|
||||
- **NEVER write comments** - code should be self-documenting
|
||||
- **Docstrings ONLY if explicitly asked**
|
||||
|
||||
## Checking commands
|
||||
After writing code, always run:
|
||||
```shell
|
||||
make fmt
|
||||
make check
|
||||
```
|
||||
@@ -0,0 +1,28 @@
|
||||
PARTS := $(patsubst %/Makefile,%,$(wildcard */Makefile))
|
||||
SERVICES := docker compose --profile services
|
||||
EXTERNAL := docker compose --profile external
|
||||
|
||||
.PHONY: env external recreate rebuild restart logs down fmt check build
|
||||
|
||||
env:
|
||||
@test -f .env || cat .env.example $(addsuffix /.env.example,$(PARTS)) > .env
|
||||
|
||||
external:
|
||||
$(EXTERNAL) up -d
|
||||
|
||||
recreate: external
|
||||
$(SERVICES) up -d --force-recreate
|
||||
|
||||
rebuild: build recreate
|
||||
|
||||
restart:
|
||||
$(SERVICES) restart
|
||||
|
||||
logs:
|
||||
$(SERVICES) logs -f --tail=100
|
||||
|
||||
down:
|
||||
$(EXTERNAL) --profile services down
|
||||
|
||||
fmt check build:
|
||||
@for part in $(PARTS); do $(MAKE) -C $$part $@ || exit 1; done
|
||||
@@ -0,0 +1,7 @@
|
||||
{% if parts %}include:
|
||||
{% for part in parts %} - path:
|
||||
- {{ part }}/docker-compose.yml
|
||||
- {{ part }}/docker-compose.${COMPOSE_ENV:-local}.yml
|
||||
project_directory: .
|
||||
{% endfor %}{% else %}services: {}
|
||||
{% endif %}
|
||||
@@ -0,0 +1 @@
|
||||
{{ _copier_answers|to_nice_yaml -}}
|
||||
Reference in New Issue
Block a user