This repository has been archived by the owner on May 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
77 lines (64 loc) · 2.47 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
include env.mk
SUDO=
.EXPORT_ALL_VARIABLES:
PATH = $(shell pwd)/.build:$(shell echo $$PATH)
all: build run
build:
CGO_ENABLED=0 GO111MODULE=on go build -tags=nomsgpack -o ./.build/backup-repository
test: ## Unit tests
go test -v ./... -covermode=count -coverprofile=coverage.out
integration-test: prepare-tools _prepare-env _pytest ## End-To-End tests with Kubernetes
_pytest: ## Shortcut for E2E tests without setting up the environment
pipenv sync
pipenv run pytest -s
_prepare-env:
kubectl apply -f "helm/backup-repository-server/templates/crd.yaml"
kubectl apply -f "docs/examples/" -n backups
run:
export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE; \
export AWS_SECRET_ACCESS_KEY=wJaFuCKtnFEMI/CApItaliSM/bPxRfiCYEXAMPLEKEY; \
\
backup-repository \
--db-password=postgres \
--db-user=postgres \
--db-password=postgres \
--db-name=postgres \
--health-check-key=changeme \
--jwt-secret-key="secret key" \
--storage-io-timeout="5m" \
--listen=":${SERVER_PORT}" \
--provider=kubernetes \
--storage-url="s3://mybucket?endpoint=localhost:9000&disableSSL=true&s3ForcePathStyle=true®ion=eu-central-1"
run_with_local_config_storage:
export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE; \
export AWS_SECRET_ACCESS_KEY=wJaFuCKtnFEMI/CApItaliSM/bPxRfiCYEXAMPLEKEY; \
\
./.build/backup-repository \
--db-password=postgres \
--db-user=postgres \
--db-password=postgres \
--db-name=postgres \
--health-check-key=changeme \
--jwt-secret-key="secret key" \
--storage-io-timeout="5m" \
--listen=":${SERVER_PORT}" \
--provider=filesystem \
--config-local-path=$$(pwd)/docs/examples-filesystem/\
--storage-url="s3://mybucket?endpoint=localhost:9000&disableSSL=true&s3ForcePathStyle=true®ion=eu-central-1"
postgres: ## Runs local PostgreSQL for running project as local binary
docker run -p 5432:5432 -d --rm --name postgres -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres postgres:15.3-alpine
minio: ## Runs local Min.io for running project as local binary
docker run -d \
--name br_minio \
-p 9000:9000 \
-p 9001:9001 \
-v $$(pwd)/.build/minio:/data \
-e "MINIO_ROOT_USER=AKIAIOSFODNN7EXAMPLE" \
-e "MINIO_ROOT_PASSWORD=wJaFuCKtnFEMI/CApItaliSM/bPxRfiCYEXAMPLEKEY" \
--entrypoint /bin/sh \
quay.io/minio/minio:RELEASE.2022-02-16T00-35-27Z -c 'mkdir -p /data/mybucket && minio server /data --console-address 0.0.0.0:9001'
lint:
export GO111MODULE=on; \
golangci-lint run \
--verbose \
--build-tags build