-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (35 loc) · 1.31 KB
/
Makefile
File metadata and controls
46 lines (35 loc) · 1.31 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
GO = go
EXT =
PLAKAR ?= plakar
VERSION ?= v1.0.0
GOOS := $(shell go env GOOS)
GOARCH := $(shell go env GOARCH)
PTAR := postgresql_$(VERSION)_$(GOOS)_$(GOARCH).ptar
all: build
build:
${GO} build -v -o postgresqlImporter${EXT} ./plugin/importer
${GO} build -v -o postgresqlExporter${EXT} ./plugin/exporter
${GO} build -v -o postgresqlBinImporter${EXT} ./plugin/binimporter
${GO} build -v -o postgresqlAWSImporter${EXT} ./plugin/awsimporter
${GO} build -v -o postgresqlAWSExporter${EXT} ./plugin/awsexporter
package: build
rm -f $(PTAR)
$(PLAKAR) pkg create ./manifest.yaml $(VERSION)
uninstall:
-$(PLAKAR) pkg rm postgresql
install: package
$(PLAKAR) pkg add ./$(PTAR)
reinstall: uninstall install
# Start a throw-away PostgreSQL instance for restore testing.
# The restore hint is printed first since docker run blocks.
testdb:
@echo "To restore a snapshot to this database:"
@echo " $(PLAKAR) destination rm mydb"
@echo " $(PLAKAR) destination add mydb postgres://postgres@localhost:9999 password=postgres"
@echo " $(PLAKAR) restore -to @mydb <snapid>"
@echo ""
docker run --rm -ti --name test -p 9999:5432 -e POSTGRES_PASSWORD=postgres postgres
test:
${GO} test -v ./tests/...
clean:
rm -f postgresqlImporter postgresqlExporter postgresqlBinImporter postgresqlAWSImporter postgresqlAWSExporter