Repository navigation
Expand file tree
/
Copy pathjustfile
More file actions
95 lines (70 loc) · 3.01 KB
/
Copy pathjustfile
File metadata and controls
95 lines (70 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
95
venv := ".venv"
webcomponents := "src/imio.smartweb.core/src/imio/smartweb/core/webcomponents"
# Generic image checks from IMIO/gha; point it at a local clone to work on them:
# `just PLONE_IMAGE_TEST=/path/to/gha/plone-image-test-notify test`
PLONE_IMAGE_TEST := env("PLONE_IMAGE_TEST", "git+https://github.com/IMIO/gha@main#subdirectory=plone-image-test-notify")
# Install uv from https://docs.astral.sh/uv/getting-started/installation/
uv := require("uv")
# Display this help message
help:
@just --list
# Install development environment
install: _buildout-bin _pre-commit
{{ venv }}/bin/buildout
cd {{ webcomponents }} && npm install
# Start the instance
start: _instance _pre-commit solr-background
bin/instance fg
# Start the instance + Vite dev server (webcomponents HMR)
dev: _instance _pre-commit solr-background _node-modules
#!/usr/bin/env bash
trap 'kill 0' EXIT INT TERM
VITE_DEV_URL=http://localhost:2000 bin/instance fg &
(cd {{ webcomponents }} && npm run watch) &
wait
# Build the webcomponents production bundle (Vite)
build: _node-modules
cd {{ webcomponents }} && npm run build
# Clean development environment
cleanall:
rm -fr .git/hooks/pre-commit .installed.cfg .mr.developer.cfg .venv bin buildout.cfg develop-eggs downloads eggs include lib lib64 local parts pyvenv.cfg
# Run upgrade steps
upgrade-steps:
bin/instance -O Plone run scripts/run_portal_upgrades.py
# Build the prod image, boot it with Postgres/Solr/memcached and run the smoke tests
test:
uvx --from "{{ PLONE_IMAGE_TEST }}" plone-image-test \
--compose-file tests/docker-compose.test.yml \
--addons imio.smartweb.policy \
--log-allowlist tests/log_allowlist.txt \
-v tests
# Run pre-commit hooks
lint:
uvx pre-commit run --all
# Run full release with uvx zest.releaser
release:
uvx --from zest.releaser fullrelease
# Start solr container (foreground)
solr: _solr-permissions
docker compose up solr
# Start solr container (background)
solr-background: _solr-permissions
docker compose up solr -d
# Start solr cluster
solr-cluster:
docker compose -f docker-compose-solr-cluster.yml up
# The steps below replace Make's file targets: each one runs only when its file is missing.
_solr-permissions:
@if [ -d solr ] && [ "$(stat -c %a solr)" != "777" ]; then sudo chmod -R 777 solr; fi
_venv:
@[ -d {{ venv }} ] || { echo "Creating virtual environment with uv"; uv venv; }
_buildout-cfg:
@[ -e buildout.cfg ] || ln -fs dev.cfg buildout.cfg
_buildout-bin: _venv _buildout-cfg
@[ -x {{ venv }}/bin/buildout ] || { echo "Installing requirements with uv pip interface"; uv pip install -r requirements.txt; }
_instance: _buildout-bin
@[ -x bin/instance ] || { echo "Bootstrapping environment with buildout"; {{ venv }}/bin/buildout; }
_node-modules:
@[ -d {{ webcomponents }}/node_modules ] || { cd {{ webcomponents }} && npm install; }
_pre-commit: _venv
@[ -e .git/hooks/pre-commit ] || { echo "Installing pre-commit hooks"; uvx pre-commit install; }