forked from iloveitaly/python-starter-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopier.yml
More file actions
94 lines (75 loc) · 3.01 KB
/
copier.yml
File metadata and controls
94 lines (75 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# NOTE some limitations of copier:
#
# - any extensions must be installed manually
# - you cannot use dst_path as default answers
_min_copier_version: 9.4.1
_jinja_extensions:
- jinja2_shell_extension.ShellExtension
_message_before_copy: |
IMPORTANT!!
Install mise and docker before continuing.
_message_after_copy: |
Next steps:
1. Configure all 1p secret references in '.env*' (rg 'op://' --hidden)
2. Run 'just setup' or 'just setup --extras'
3. Run 'just py_dev' to start a dev server
4. Take a look at recommended shell hooks, etc specified in the readme.
If you don't have direnv setup properly, you can prefix any of the above commands with
`direnv exec .` to execute them with the proper environment variables.
project_slug:
type: str
help: Dash separated project slug
default: "{{ \"basename $(pwd)\" | shell() | trim | regex_replace(' ', '-') | regex_replace('_', '-') }}"
validator: >-
{% if not (project_slug | regex_search('^[a-z][a-z0-9-_]+$')) %}
project_slug must start with a letter, followed one or more letters, digits or dashes all lowercase.
{% endif %}
# https://github.com/superlinear-ai/substrate/blob/main/copier.yml
project_name_snake_case:
when: false
default: "{{ project_name | lower | replace('-', '_') }}"
from_email:
type: str
help: The email account to send emails from, you can set it later in .env
default: noreply@example.com
registry_base:
type: str
help: Base URL of the container registry to push to
default: "ghcr.io/{{ \"gh api user --jq '.login'\" | shell() | trim }}"
production_image_name:
type: str
help: The production image name, with registry base, that the build system should push to
default: "{{ registry_base }}/{{ project_slug }}"
one_password_account:
type: str
help: 'The domain of the 1password account to use. Example: "example.1password.com". Use "op account list" to get the list of accounts.'
default: "{{ \"op account list --format json | jq -r '.[0].url' || echo ''\" | shell() | trim }}"
one_password_vault:
type: str
help: The UUID of the 1password vault to use. Use "op vault list" to get the list of vaults.
validator: >-
{% if not (one_password_vault | regex_search('^[a-zA-Z0-9]+$')) %}
one_password_vault must be a valid UUID from 1password
{% endif %}
# TODO ask for port starting range and replace in files
_exclude:
- metadata.json
- .github/workflows/repo-sync.yml
- TODO
- /.git
- /README.md
- /LICENSE.md
- tests/integration/__snapshots__
- copier.yml
- /playground
_tasks:
- git init
- git add -A
- git commit -m "🎉 Initial commit"
- ["{{ _copier_python }}", .copier/bootstrap.py]
- "git add -A && git commit -m 'build: default template values updated'"
- ["{{ _copier_python }}", .copier/pick_unique_ports.py]
- "git add -A && git commit -m 'build: selected random ports'"
- "command -v direnv >/dev/null 2>&1 && direnv allow ."
# although it's annoying to have the .copier-answers.yml file in the root, it allows `copier update`
# to work properly