-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy path.envrc
More file actions
65 lines (52 loc) · 1.78 KB
/
.envrc
File metadata and controls
65 lines (52 loc) · 1.78 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
# direnv configuration for Netresearch TimeTracker
# Load local environment if present
dotenv_if_exists .env
dotenv_if_exists .env.local
# Helpful environment
export TIMETRACKER_NAME="Netresearch TimeTracker"
export TIMETRACKER_PORT="8765"
export TIMETRACKER_URL="http://localhost:${TIMETRACKER_PORT}"
export APP_ENV="${APP_ENV:-dev}"
# Add local bin to PATH if exists
PATH_add bin
tthelp() {
cat <<'EOF'
Netresearch TimeTracker — developer help
URL: ${TIMETRACKER_URL}
Common make targets:
make up # build + start stack (nginx, app, db)
make down # stop stack
make restart # restart stack
make bake # build production image
make bake-dev # build development image
make bake-all # build all images
make logs # follow logs
make sh # shell into app container (requires make up)
Dependencies & assets:
make install # composer install + npm install
make composer-install|update
make npm-build|dev|watch
Quality & tests:
make test # run test suite
make coverage # run tests with HTML coverage in var/coverage
make stan # PHPStan
make psalm # Psalm
make cs-check # PHP_CodeSniffer
make cs-fix # PHP-CS-Fixer
make check-all # stan + psalm + phpcs
make fix-all # psalm alter + php-cs-fixer + rector
Docs:
Swagger UI: ${TIMETRACKER_URL}/docs/swagger/index.html
README: README.rst
Dev docs: docs/development.md
Tip: First time here? Run: direnv allow
EOF
}
# Print welcome/help when entering the directory
if [ -z "${TT_ENVRC_SHOWN:-}" ]; then
export TT_ENVRC_SHOWN=1
echo
echo "[${TIMETRACKER_NAME}] ${TIMETRACKER_URL} (APP_ENV=${APP_ENV})"
echo "Type 'tthelp' for developer commands."
echo
fi