|
10 | 10 | pretest \ |
11 | 11 | test \ |
12 | 12 | cov \ |
13 | | - clean \ |
14 | | - build-integration \ |
15 | | - clean-integration \ |
16 | | - fetch-rdb \ |
17 | | - fetch-redis \ |
18 | | - diff-cveid \ |
19 | | - diff-package \ |
20 | | - diff-server-rdb \ |
21 | | - diff-server-redis \ |
22 | | - diff-server-rdb-redis |
| 13 | + clean |
23 | 14 |
|
24 | 15 | SRCS = $(shell git ls-files '*.go') |
25 | 16 | PKGS = $(shell go list ./...) |
|
67 | 58 |
|
68 | 59 | clean: |
69 | 60 | echo $(PKGS) | xargs go clean || exit; |
70 | | - |
71 | | -PWD := $(shell pwd) |
72 | | -BRANCH := $(shell git symbolic-ref --short HEAD) |
73 | | -build-integration: |
74 | | - @ git stash save |
75 | | - $(GO) build -ldflags "$(LDFLAGS)" -o integration/go-cve.new |
76 | | - git checkout $(shell git describe --tags --abbrev=0) |
77 | | - @git reset --hard |
78 | | - $(GO) build -ldflags "$(LDFLAGS)" -o integration/go-cve.old |
79 | | - git checkout $(BRANCH) |
80 | | - -@ git stash apply stash@{0} && git stash drop stash@{0} |
81 | | - |
82 | | -clean-integration: |
83 | | - -pkill go-cve.old |
84 | | - -pkill go-cve.new |
85 | | - -rm integration/go-cve.old integration/go-cve.new integration/cve.old.sqlite3 integration/cve.new.sqlite3 |
86 | | - -rm -rf integration/diff |
87 | | - -docker kill redis-old redis-new |
88 | | - -docker rm redis-old redis-new |
89 | | - |
90 | | -fetch-rdb: |
91 | | - integration/go-cve.old fetch nvd --dbpath=$(PWD)/integration/cve.old.sqlite3 |
92 | | - integration/go-cve.old fetch jvn --dbpath=$(PWD)/integration/cve.old.sqlite3 |
93 | | - |
94 | | - integration/go-cve.new fetch nvd --dbpath=$(PWD)/integration/cve.new.sqlite3 |
95 | | - integration/go-cve.new fetch jvn --dbpath=$(PWD)/integration/cve.new.sqlite3 |
96 | | - |
97 | | -fetch-redis: |
98 | | - docker run --name redis-old -d -p 127.0.0.1:6379:6379 redis |
99 | | - docker run --name redis-new -d -p 127.0.0.1:6380:6379 redis |
100 | | - |
101 | | - integration/go-cve.old fetch nvd --dbtype redis --dbpath "redis://127.0.0.1:6379/0" |
102 | | - integration/go-cve.old fetch jvn --dbtype redis --dbpath "redis://127.0.0.1:6379/0" |
103 | | - |
104 | | - integration/go-cve.new fetch nvd --dbtype redis --dbpath "redis://127.0.0.1:6380/0" |
105 | | - integration/go-cve.new fetch jvn --dbtype redis --dbpath "redis://127.0.0.1:6380/0" |
106 | | - |
107 | | -diff-cveid: |
108 | | - @ python integration/diff_server_mode.py cves --sample_rate 0.01 |
109 | | - |
110 | | -diff-cpes: |
111 | | - @ python integration/diff_server_mode.py cpes --sample_rate 0.01 |
112 | | - @ python integration/diff_server_mode.py cpe_ids --sample_rate 0.01 |
113 | | - |
114 | | -diff-server-rdb: |
115 | | - - pkill -KILL go-cve.old |
116 | | - - pkill -KILL go-cve.new |
117 | | - integration/go-cve.old server --dbpath=$(PWD)/integration/cve.old.sqlite3 --port 1325 > /dev/null 2>&1 & |
118 | | - integration/go-cve.new server --dbpath=$(PWD)/integration/cve.new.sqlite3 --port 1326 > /dev/null 2>&1 & |
119 | | - make diff-cveid |
120 | | - make diff-cpes |
121 | | - pkill go-cve.old |
122 | | - pkill go-cve.new |
123 | | - |
124 | | -diff-server-redis: |
125 | | - - pkill -KILL go-cve.old |
126 | | - - pkill -KILL go-cve.new |
127 | | - integration/go-cve.old server --dbtype redis --dbpath "redis://127.0.0.1:6379/0" --port 1325 > /dev/null 2>&1 & |
128 | | - integration/go-cve.new server --dbtype redis --dbpath "redis://127.0.0.1:6380/0" --port 1326 > /dev/null 2>&1 & |
129 | | - make diff-cveid |
130 | | - make diff-cpes |
131 | | - pkill go-cve.old |
132 | | - pkill go-cve.new |
133 | | - |
134 | | -diff-server-rdb-redis: |
135 | | - - pkill -KILL go-cve.old |
136 | | - - pkill -KILL go-cve.new |
137 | | - integration/go-cve.new server --dbpath=$(PWD)/integration/cve.new.sqlite3 --port 1325 > /dev/null 2>&1 & |
138 | | - integration/go-cve.new server --dbtype redis --dbpath "redis://127.0.0.1:6380/0" --port 1326 > /dev/null 2>&1 & |
139 | | - make diff-cveid |
140 | | - make diff-cpes |
141 | | - pkill go-cve.new |
0 commit comments