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 2
/
examples.mk
60 lines (49 loc) · 2.66 KB
/
examples.mk
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
.PHONY: test
# <test pipelines>
test: test_sync_without_encryption test_sync_using_envs test_remote_to_local
test_k8s: test_k8s_without_encryption_scheduler_permissions test_k8s_dynamic_directory_name test_k8s_with_encryption
# <end of test pipelines>
#
# Uses commandline switches to configure rclone
#
.PHONY: test_sync_without_encryption
test_sync_without_encryption:
.build/volume-syncing-controller sync-to-remote -d testbucket -p 'type=s3' -p 'provider=Minio' -p 'access_key_id=AKIAIOSFODNN7EXAMPLE' -p 'secret_access_key = wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY' -p 'endpoint = http://localhost:9000' -p 'acl = private'
#
# Environment variables are more handy when using Docker, docker-compose and Kubernetes
#
.PHONY: test_sync_using_envs
test_sync_using_envs:
export REMOTE_TYPE=s3; \
export REMOTE_PROVIDER=Minio; \
export REMOTE_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE; \
export REMOTE_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY; \
export REMOTE_ENDPOINT=http://localhost:9000; \
export REMOTE_ACL=private; \
.build/volume-syncing-controller sync-to-remote -d testbucket
.PHONY: test_sync_every_1_minute
test_sync_every_1_minute:
export REMOTE_TYPE=s3; \
export REMOTE_PROVIDER=Minio; \
export REMOTE_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE; \
export REMOTE_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY; \
export REMOTE_ENDPOINT=http://localhost:9000; \
export REMOTE_ACL=private; \
.build/volume-syncing-controller sync-to-remote -d testbucket --schedule "@every 1m"
test_remote_to_local:
# upload
.build/volume-syncing-controller sync-to-remote -d testbucket -s ./pkg -p 'type=s3' -p 'provider=Minio' -p 'access_key_id=AKIAIOSFODNN7EXAMPLE' -p 'secret_access_key = wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY' -p 'endpoint = http://localhost:9000' -p 'acl = private'
# then download into different directory
.build/volume-syncing-controller remote-to-local-sync -v -s testbucket -d ./.build/testing-restore -p 'type=s3' -p 'provider=Minio' -p 'access_key_id=AKIAIOSFODNN7EXAMPLE' -p 'secret_access_key = wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY' -p 'endpoint = http://localhost:9000' -p 'acl = private'
_test_k8s_variant:
kubectl delete -f tests/.examples/${VARIANT}/sync.yaml || true
kubectl delete -f tests/.examples/${VARIANT}/pod.yaml || true
sleep 1
kubectl apply -f tests/.examples/${VARIANT}/sync.yaml
kubectl apply -f tests/.examples/${VARIANT}/pod.yaml
test_k8s_without_encryption_scheduler_permissions:
make _test_k8s_variant VARIANT=minio-without-encryption-scheduler-permissions
test_k8s_dynamic_directory_name:
make _test_k8s_variant VARIANT=with-dynamic-directory-name
test_k8s_with_encryption:
make _test_k8s_variant VARIANT=with-encryption