Makefile 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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 "-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:
  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: build
  45. docker compose -f compose/local-replicate-compose.yml -p seaweedfs up
  46. dev_auditlog: build
  47. docker compose -f compose/local-auditlog-compose.yml -p seaweedfs up
  48. dev_nextcloud: build
  49. docker compose -f compose/local-nextcloud-compose.yml -p seaweedfs up
  50. cluster: build
  51. docker compose -f compose/local-cluster-compose.yml -p seaweedfs up
  52. 2clusters: build
  53. docker compose -f compose/local-clusters-compose.yml -p seaweedfs up
  54. 2mount: build
  55. docker compose -f compose/local-sync-mount-compose.yml -p seaweedfs up
  56. hashicorp_raft: build
  57. docker compose -f compose/local-hashicorp-raft-compose.yml -p seaweedfs up
  58. s3tests: build s3tests_build
  59. docker compose -f compose/local-s3tests-compose.yml -p seaweedfs up
  60. filer_etcd: build
  61. docker stack deploy -c compose/swarm-etcd.yml fs
  62. test_etcd: build
  63. docker compose -f compose/test-etcd-filer.yml -p seaweedfs up
  64. test_ydb: tags = ydb
  65. test_ydb: build
  66. export
  67. docker compose -f compose/test-ydb-filer.yml -p seaweedfs up
  68. clean:
  69. rm ./weed
  70. certstrap:
  71. go get github.com/square/certstrap
  72. certstrap --depot-path compose/tls init --passphrase "" --common-name "SeaweedFS CA" || true
  73. certstrap --depot-path compose/tls request-cert --passphrase "" --common-name volume01.dev || true
  74. certstrap --depot-path compose/tls request-cert --passphrase "" --common-name master01.dev || true
  75. certstrap --depot-path compose/tls request-cert --passphrase "" --common-name filer01.dev || true
  76. certstrap --depot-path compose/tls request-cert --passphrase "" --common-name client01.dev || true
  77. certstrap --depot-path compose/tls sign --CA "SeaweedFS CA" volume01.dev || true
  78. certstrap --depot-path compose/tls sign --CA "SeaweedFS CA" master01.dev || true
  79. certstrap --depot-path compose/tls sign --CA "SeaweedFS CA" filer01.dev || true
  80. certstrap --depot-path compose/tls sign --CA "SeaweedFS CA" client01.dev || true