forked from adiom-data/dsync
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (45 loc) · 2.74 KB
/
Makefile
File metadata and controls
61 lines (45 loc) · 2.74 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
.PHONY: dsync clean clean-dbs verify bootstrap1 bootstrap2 sync12 test-all test clean-testdb test-mongo test-cosmos mocks
RUN_CMD=go run main.go
dsync:
go build -o dsync main.go
clean:
go clean -modcache
docker:
echo 'Building Dsync'
SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) docker buildx build --push --platform linux/amd64,linux/arm64 -t markadiom/dsync .
echo 'Building Cosmos Connector'
SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) docker buildx build --push --platform linux/amd64,linux/arm64 -t markadiom/cosmosnosqlconnector java/
clean-dbs:
PORT=27017 ./scripts/clean-mongo.sh
PORT=27018 ./scripts/clean-mongo.sh
verify:
$(RUN_CMD) -m "mongodb://mongo1:27017/?replicaSet=data1" --verbosity INFO --verify "mongodb://mongo1:27017/?replicaSet=data1" "mongodb://mongo2:27018/?replicaSet=data2"
bootstrap1:
$(RUN_CMD) -m "mongodb://mongo1:27017/?replicaSet=data1" --verbosity INFO testconn://./fixture "mongodb://mongo1:27017/?replicaSet=data1"
bootstrap2:
$(RUN_CMD) -m "mongodb://mongo1:27017/?replicaSet=data1" --verbosity INFO testconn://./fixture "mongodb://mongo2:27018/?replicaSet=data2"
sync12:
$(RUN_CMD) -m "mongodb://mongo1:27017/?replicaSet=data1" --verbosity INFO "mongodb://mongo1:27017/?replicaSet=data1" "mongodb://mongo2:27018/?replicaSet=data2"
test-all:
go test -count=1 -v -p 1 --tags=external ./...
test:
go test ./...
test-cosmos:
echo 'Ensure that you have exported COSMOS_TEST pointing to your instance'
go test -count=1 -v --tags=external github.com/adiom-data/dsync/connectors/cosmos
clean-testdb:
PORT=27019 ./scripts/clean-mongo.sh
$(RUN_CMD) -m "mongodb://mongotest:27019/?replicaSet=datatest" --verbosity INFO --namespace testconn.test1,testconn.test2,testconn.test3,testconn.test4 testconn://./fixture "mongodb://mongotest:27019/?replicaSet=datatest"
test-mongo:
MONGO_TEST=mongodb://mongotest:27019/?replicaSet=datatest go test -count=1 -v --tags=external github.com/adiom-data/dsync/connectors/mongo
test-dynamodb:
echo 'Ensure that localstack is running'
AWS_ACCESS_KEY_ID=foobar AWS_SECRET_ACCESS_KEY=foobar go test -count=1 -v --tags=external github.com/adiom-data/dsync/connectors/dynamodb
mocks:
mockery --output ./protocol/iface/mocks --srcpkg ./protocol/iface --name Connector
mockery --output ./protocol/iface/mocks --srcpkg ./protocol/iface --name Coordinator
mockery --output ./protocol/iface/mocks --srcpkg ./protocol/iface --name Runner
mockery --output ./protocol/iface/mocks --srcpkg ./protocol/iface --name Transport
mockery --output ./protocol/iface/mocks --srcpkg ./protocol/iface --name ConnectorICoordinatorSignal
mockery --output ./protocol/iface/mocks --srcpkg ./protocol/iface --name CoordinatorIConnectorSignal
mockery --output ./protocol/iface/mocks --srcpkg ./protocol/iface --name Statestore