Advertisement
Guest User

Untitled

a guest
Aug 5th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. #
  4. # Spin up couchbase in a container
  5. #
  6.  
  7. PROGNAME=$(basename $0)
  8. : ${VERSION:=community-3.1.3}
  9.  
  10. alias couchbase-cli="docker exec couchbase couchbase-cli"
  11.  
  12. set -ex
  13.  
  14. if test "$(docker ps --filter name=couchbase -a --format exists)" = exists; then
  15. docker start couchbase
  16. else
  17. docker run \
  18. --name couchbase \
  19. --detach \
  20. -e CB_REST_USERNAME=Administrator \
  21. -e CB_REST_PASSWORD=password \
  22. -p 8091:8091 \
  23. -p 8092:8092 \
  24. -p 8093:8093 \
  25. -p 8094:8094 \
  26. -p 11207:11207 \
  27. -p 11210:11210 \
  28. -p 11211:11211 \
  29. -p 18091:18091 \
  30. -p 18092:18092 \
  31. -p 18093:18093 \
  32. couchbase:${VERSION}
  33. fi
  34.  
  35. while ! couchbase-cli bucket-list -c localhost; do
  36. echo "${PROGNAME}: waiting for couchbase" >&2
  37. sleep 1
  38. done
  39.  
  40. if ! couchbase-cli bucket-list -c localhost | grep -q '^default$'; then
  41. couchbase-cli bucket-create -c localhost \
  42. --bucket=default \
  43. --bucket-type=couchbase \
  44. --bucket-password= \
  45. --bucket-ramsize=100 \
  46. --bucket-replica=0 \
  47. --bucket-priority=low \
  48. --wait
  49. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement