-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathTaskfile.dist.yml
More file actions
107 lines (90 loc) · 3.25 KB
/
Taskfile.dist.yml
File metadata and controls
107 lines (90 loc) · 3.25 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
104
105
106
107
version: '3'
vars:
VERSION:
sh: cat VERSION
GIT_COMMIT:
sh: git log -n 1 --format=%h
DIST_DIR: build/{{OS}}_{{ARCH}}
SF_VERSION: "1_11"
SF_URL: "https://www.itforarchivists.com/siegfried/latest/{{.SF_VERSION}}/default"
tasks:
bundle:
desc: Build a self-contained distribution bundle for the current platform
cmds:
- task: setup
- task: binaries
- task: siegfried
- task: nsrl
- task: readme
- echo "Distribution bundle ready at {{.DIST_DIR}}/"
setup:
desc: Create the distribution directory structure
cmds:
- mkdir -p {{.DIST_DIR}}/db
status:
- test -d {{.DIST_DIR}}/db
binaries:
desc: Build and copy binaries into the distribution folder
deps: [setup]
cmds:
- task: ftrove:build
- task: admftrove:build
- cp cmd/ftrove/ftrove {{.DIST_DIR}}/
- cp cmd/admftrove/admftrove {{.DIST_DIR}}/
# Copy static binaries if they exist (not built on all platforms)
- cp cmd/ftrove/ftrove_*_static {{.DIST_DIR}}/ 2>/dev/null || true
- cp cmd/admftrove/admftrove_*_static {{.DIST_DIR}}/ 2>/dev/null || true
siegfried:
desc: Download siegfried signature file into the distribution folder
deps: [setup]
cmds:
- curl --progress-bar -L -o {{.DIST_DIR}}/db/siegfried.sig "{{.SF_URL}}"
interactive: true
status:
- test -f {{.DIST_DIR}}/db/siegfried.sig
nsrl:
desc: Copy an nsrl bloom filter into the distribution folder (NSRL_VARIANT=modern|mobile|all, default all)
deps: [setup]
vars:
NSRL_VARIANT: '{{default "all" .NSRL_VARIANT}}'
preconditions:
- sh: test -f db/nsrl-{{.NSRL_VARIANT}}.bloom
msg: "db/nsrl-{{.NSRL_VARIANT}}.bloom not found. Build it first with: task nsrl:build-{{.NSRL_VARIANT}}"
cmds:
- cp db/nsrl-{{.NSRL_VARIANT}}.bloom {{.DIST_DIR}}/db/nsrl-{{.NSRL_VARIANT}}.bloom
status:
- test -f {{.DIST_DIR}}/db/nsrl-{{.NSRL_VARIANT}}.bloom
readme:
desc: Generate a quick-start README for the distribution bundle
deps: [setup]
cmds:
- |
cat > {{.DIST_DIR}}/README.txt <<'READMEEOF'
FileTrove {{.VERSION}}
========================
Quick Start
-----------
1. cd into this directory
2. Run the installer to create the scan database:
./ftrove --install .
3. Scan a directory:
./ftrove -i /path/to/files
4. View results:
./ftrove -l # list sessions
./ftrove -t <session-uuid> # export to TSV
The db/ folder contains:
- siegfried.sig PRONOM signature database (pre-installed)
- nsrl-all.bloom NSRL Bloom filter (pre-installed, variant: all)
- filetrove.db created by --install (per-project scan database)
For full documentation see: https://github.com/steffenfritz/FileTrove
READMEEOF
archive:
desc: Create a compressed tar archive of the distribution bundle
deps: [bundle]
cmds:
- tar -czf build/filetrove_{{.VERSION}}_{{OS}}_{{ARCH}}.tar.gz -C build {{OS}}_{{ARCH}}
- echo "Archive created at build/filetrove_{{.VERSION}}_{{OS}}_{{ARCH}}.tar.gz"
clean:
desc: Remove all distribution bundles
cmds:
- rm -rf build/