forked from sysflow-telemetry/sf-processor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
64 lines (52 loc) · 1.55 KB
/
Makefile
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
#
# Copyright (C) 2020 IBM Corporation.
#
# Authors:
# Frederico Araujo <frederico.araujo@ibm.com>
# Teryl Taylor <terylt@ibm.com>
#
# Build environment configuration
include ./makefile.manifest.inc
# Basic go commands
GOCMD=go
GOBUILD=$(GOCMD) build -tags exclude_graphdriver_btrfs
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get -tags exclude_graphdriver_btrfs
BIN=sfprocessor
OUTPUT=$(BIN)
SRC=./driver
.PHONY: build
build: version deps
cd $(SRC) && $(GOBUILD) -o $(OUTPUT) -v
.PHONY: deps
deps:
cd $(SRC) && $(GOGET) ./...
.PHONY: version
version:
cp $(SRC)/manifest/manifest.go.in $(SRC)/manifest/manifest.go
sed -ibak -e "s/SYSFLOW_VERSION/$(SYSFLOW_VERSION)/" -e "s/\"JSON_SCHEMA_VERSION\"/$(SYSFLOW_JSON_SCHEMA_VERSION)/" -e "s/BUILD_NUMBER/$(SYSFLOW_BUILD_NUMBER)/" $(SRC)/manifest/manifest.go
rm -f $(SRC)/manifest/manifest.gobak
.PHONY: test
test:
cd $(SRC) && $(GOTEST) -v ./...
.PHONY: clean
clean:
cd $(SRC) && $(GOCLEAN)
rm -f $(SRC)/$(BIN)
rm -f $(SRC)/manifest/manifest.go
.PHONY: install
install: build
mkdir -p /usr/local/sysflow/bin /usr/local/sysflow/conf /usr/local/sysflow/resources/policies
cp ./driver/sfprocessor /usr/local/sysflow/bin/sfprocessor
cp ./resources/pipelines/pipeline.distribution.json /usr/local/sysflow/conf/pipeline.json
cp ./resources/policies/distribution/* /usr/local/sysflow/resources/policies/
.PHONY: docker-build
docker-build: build
docker build -t sf-processor --target=runtime -f Dockerfile .
.PHONY: pull
pull:
git pull origin master
.PHONY: up
up:
sudo docker-compose -f docker-compose.yml up