Makefile 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. all: gen
  2. .PHONY : gen
  3. gen: dev
  4. cgo ?= 0
  5. binary:
  6. export SWCOMMIT=$(shell git rev-parse --short HEAD)
  7. export SWLDFLAGS="-X github.com/seaweedfs/seaweedfs/weed/util.COMMIT=$(SWCOMMIT)"
  8. cd ../weed && CGO_ENABLED=$(cgo) GOOS=linux go build $(options) -tags "$(tags)" -ldflags "-s -w -extldflags -static $(SWLDFLAGS)" && mv weed ../docker/
  9. binary_race: options = -race
  10. binary_race: cgo = 1
  11. binary_race: binary
  12. build: binary
  13. docker build --no-cache -t chrislusf/seaweedfs:local -f Dockerfile.local .
  14. build_e2e: binary_race
  15. docker build --no-cache -t chrislusf/seaweedfs:e2e -f Dockerfile.e2e .
  16. go_build: # make go_build tags=elastic,ydb,gocdk,hdfs,5BytesOffset
  17. docker build --build-arg TAGS=$(tags) --no-cache -t chrislusf/seaweedfs:go_build -f Dockerfile.go_build .
  18. go_build_large_disk:
  19. docker build --build-arg TAGS=large_disk --no-cache -t chrislusf/seaweedfs:large_disk -f Dockerfile.go_build .
  20. build_rocksdb_dev_env:
  21. docker build --no-cache -t chrislusf/rocksdb_dev_env -f Dockerfile.rocksdb_dev_env .
  22. build_rocksdb_local: build_rocksdb_dev_env
  23. cd .. ; docker build --no-cache -t chrislusf/seaweedfs:rocksdb_local -f docker/Dockerfile.rocksdb_large_local .
  24. build_rocksdb:
  25. docker build --no-cache -t chrislusf/seaweedfs:rocksdb -f Dockerfile.rocksdb_large .
  26. s3tests_build:
  27. docker build --no-cache -t chrislusf/ceph-s3-tests:local -f Dockerfile.s3tests .
  28. dev: build
  29. docker compose -f compose/local-dev-compose.yml -p seaweedfs up
  30. dev_race: binary_race
  31. docker compose -f compose/local-dev-compose.yml -p seaweedfs up
  32. dev_tls: build certstrap
  33. ENV_FILE="tls.env" docker compose -f compose/local-dev-compose.yml -p seaweedfs up
  34. dev_mount: build
  35. docker compose -f compose/local-mount-compose.yml -p seaweedfs up
  36. run_image: build
  37. docker run --rm -ti --device /dev/fuse --cap-add SYS_ADMIN --entrypoint /bin/sh chrislusf/seaweedfs:local
  38. profile_mount: build
  39. docker compose -f compose/local-mount-profile-compose.yml -p seaweedfs up
  40. k8s: build
  41. docker compose -f compose/local-k8s-compose.yml -p seaweedfs up
  42. dev_registry: build
  43. docker compose -f compose/local-registry-compose.yml -p seaweedfs up
  44. dev_replicate:
  45. docker build --build-arg TAGS=gocdk --no-cache -t chrislusf/seaweedfs:local -f Dockerfile.go_build .
  46. docker compose -f compose/local-replicate-compose.yml -p seaweedfs up
  47. dev_auditlog: build
  48. docker compose -f compose/local-auditlog-compose.yml -p seaweedfs up
  49. dev_nextcloud: build
  50. docker compose -f compose/local-nextcloud-compose.yml -p seaweedfs up
  51. cluster: build
  52. docker compose -f compose/local-cluster-compose.yml -p seaweedfs up
  53. 2clusters: build
  54. docker compose -f compose/local-clusters-compose.yml -p seaweedfs up
  55. 2mount: build
  56. docker compose -f compose/local-sync-mount-compose.yml -p seaweedfs up
  57. hashicorp_raft: build
  58. docker compose -f compose/local-hashicorp-raft-compose.yml -p seaweedfs up
  59. s3tests: build s3tests_build
  60. docker compose -f compose/local-s3tests-compose.yml -p seaweedfs up
  61. filer_etcd: build
  62. docker stack deploy -c compose/swarm-etcd.yml fs
  63. test_etcd: build
  64. docker compose -f compose/test-etcd-filer.yml -p seaweedfs up
  65. test_ydb: tags = ydb
  66. test_ydb: build
  67. export
  68. docker compose -f compose/test-ydb-filer.yml -p seaweedfs up
  69. clean:
  70. rm ./weed
  71. certstrap:
  72. go install -v github.com/square/certstrap@latest
  73. certstrap --depot-path compose/tls init --curve P-256 --passphrase "" --common-name "SeaweedFS CA" || true
  74. certstrap --depot-path compose/tls request-cert --ou "SeaweedFS" --curve P-256 --passphrase "" --domain localhost --common-name volume01.dev || true
  75. certstrap --depot-path compose/tls request-cert --ou "SeaweedFS" --curve P-256 --passphrase "" --common-name master01.dev || true
  76. certstrap --depot-path compose/tls request-cert --ou "SeaweedFS" --curve P-256 --passphrase "" --common-name filer01.dev || true
  77. certstrap --depot-path compose/tls request-cert --ou "SeaweedFS" --curve P-256 --passphrase "" --common-name client01.dev || true
  78. certstrap --depot-path compose/tls sign --CA "SeaweedFS CA" volume01.dev || true
  79. certstrap --depot-path compose/tls sign --CA "SeaweedFS CA" master01.dev || true
  80. certstrap --depot-path compose/tls sign --CA "SeaweedFS CA" filer01.dev || true
  81. certstrap --depot-path compose/tls sign --CA "SeaweedFS CA" client01.dev || true