-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
103 lines (95 loc) · 3.88 KB
/
Makefile
File metadata and controls
103 lines (95 loc) · 3.88 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
96
97
98
99
100
101
102
103
.PHONY: generate publish-confluence publish-confluence-dry-run init assure-issue-dry-run summarise-issue-evidence assure-issue-with-evidence-dry-run publish-ticket-assurance
# Generate all NFR markdown pages (domain, simplified index, service, team/release/operation)
# against the repo mounted at /data (NFR_HOST_REPO on the host).
generate:
docker compose run --rm \
--entrypoint sh \
nfrs-toolkit -lc 'cd /data && \
python scripts/nfr/build_all_nfr_pages.py'
# Initialise baseline NFRs into the mounted repo at /data
init:
docker compose run --rm \
nfrs-toolkit init --target /data/requirements/nfrs
# Run solution assurance for a single Jira issue (dry-run: print LLM prompt only).
# Usage:
# make assure-issue-dry-run KEY=JIRA-1207
assure-issue-dry-run:
@if [ -z "$(KEY)" ]; then \
echo "Usage: make assure-issue-dry-run KEY=JIRA-1207"; \
exit 1; \
fi
docker compose run --rm \
--entrypoint sh \
nfrs-toolkit -lc 'cd /app/nfrs-toolkit && \
python -m scripts.jira.assure_issue "$(KEY)" --dry-run --format markdown'
# Summarise Excel / evidence attachments for a single Jira issue into markdown.
# Requires attachments to have been downloaded (e.g. via download_issue_attachments).
# Usage:
# make summarise-issue-evidence KEY=FTRS-1207
summarise-issue-evidence:
@if [ -z "$(KEY)" ]; then \
echo "Usage: make summarise-issue-evidence KEY=FTRS-1207"; \
exit 1; \
fi
docker compose run --rm \
--entrypoint sh \
nfrs-toolkit -lc 'cd /app/nfrs-toolkit && \
python -m scripts.jira.summarise_issue_evidence "$(KEY)"'
# End-to-end assurance prep for a single Jira issue (dry-run):
# 1) Download attachments into ATTACHMENTS_PATH
# 2) Summarise evidence spreadsheets into markdown
# 3) Run assurance dry-run (prompt includes code + evidence summary)
# Usage:
# make assure-issue-with-evidence-dry-run KEY=FTRS-1207
assure-issue-with-evidence-dry-run:
@if [ -z "$(KEY)" ]; then \
echo "Usage: make assure-issue-with-evidence-dry-run KEY=FTRS-1207"; \
exit 1; \
fi
docker compose run --rm \
--entrypoint sh \
nfrs-toolkit -lc 'cd /app/nfrs-toolkit && \
python -m scripts.jira.download_issue_attachments "$(KEY)" --output "$$ATTACHMENTS_PATH/$(KEY)" && \
python -m scripts.jira.summarise_issue_evidence "$(KEY)" && \
mkdir -p "$$ATTACHMENTS_PATH/prompts" && \
python -m scripts.jira.assure_issue "$(KEY)" --dry-run --format markdown > "$$ATTACHMENTS_PATH/prompts/$(KEY).md" && \
echo "Assurance prompt written to $$ATTACHMENTS_PATH/prompts/$(KEY).md"'
publish-confluence-dry-run:
docker compose run --rm \
--entrypoint sh \
nfrs-toolkit -lc 'cd /data && \
python scripts/confluence/publish_markdown.py \
--dry-run \
--jira-macro \
--allow-create-if-missing \
docs/nfrs/nfr-by-domain.md \
docs/nfrs/nfr-by-domain/*.md \
docs/nfrs/nfr-by-service.md \
docs/nfrs/nfr-by-service/*/*.md'
publish-confluence:
docker compose run --rm \
--entrypoint sh \
nfrs-toolkit -lc 'cd /data && \
python scripts/confluence/publish_markdown.py \
--jira-macro \
--allow-create-if-missing \
docs/nfrs/nfr-by-domain.md \
docs/nfrs/nfr-by-domain/*.md \
docs/nfrs/nfr-by-service.md \
docs/nfrs/nfr-by-service/*/*.md'
# Publish a Jira ticket assurance JSON to Confluence.
# Expects KEY and INPUT to be provided, e.g.:
# make publish-ticket-assurance KEY=FTRS-1207 INPUT=/tmp/FTRS-1207-assurance.json
publish-ticket-assurance:
@if [ -z "$(KEY)" ] || [ -z "$(INPUT)" ]; then \
echo "Usage: make publish-ticket-assurance KEY=FTRS-1207 INPUT=/path/to/assurance.json"; \
exit 1; \
fi
@if [ ! -f "$(INPUT)" ]; then \
echo "Input file not found: $(INPUT)"; \
exit 1; \
fi
docker compose run --rm \
--entrypoint sh \
nfrs-toolkit -lc 'cd /app/nfrs-toolkit && \
python scripts/confluence/publish_ticket_assurance.py "$(KEY)" --input /dev/stdin' < "$(INPUT)"