-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(onlink): Manage couchbase collections on link
Signed-off-by: Ritesh Rai <ritesh.rai@aexp.com>
- Loading branch information
1 parent
adb5e2b
commit 0661807
Showing
7 changed files
with
136 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
version: '3.7' | ||
|
||
services: | ||
couchbase: | ||
image: couchbase:latest | ||
ports: | ||
- 8091:8091 | ||
- 8092:8092 | ||
- 8093:8093 | ||
- 8094:8094 | ||
- 11210:11210 | ||
- 11207:11207 | ||
- 11211:11211 | ||
environment: | ||
- COUCHBASE_ADMINISTRATOR_USERNAME=Administrator | ||
- COUCHBASE_ADMINISTRATOR_PASSWORD=password | ||
- COUCHBASE_BUCKET=test | ||
- COUCHBASE_CONNECTION_STRING=localhost | ||
volumes: | ||
- couchbase-data:/opt/couchbase/var | ||
|
||
couchbase-init: | ||
image: couchbase:latest | ||
depends_on: | ||
- couchbase | ||
volumes: | ||
- ./init-couchbase.sh:/init-couchbase.sh | ||
entrypoint: "/init-couchbase.sh" | ||
|
||
volumes: | ||
couchbase-data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
# Wait for Couchbase to be up and running | ||
until curl -s http://couchbase:8091/pools > /dev/null; do | ||
echo "Waiting for Couchbase to be available..." | ||
sleep 1 | ||
done | ||
|
||
# Initialize the cluster with the specified username and password | ||
if /opt/couchbase/bin/couchbase-cli server-list -c couchbase:8091 -u Administrator -p password > /dev/null; then | ||
echo "Cluster already initialized" | ||
else | ||
echo "Initializing cluster..." | ||
/opt/couchbase/bin/couchbase-cli cluster-init -c couchbase:8091 --cluster-username Administrator --cluster-password password --cluster-ramsize 512 --services data,index,query,fts | ||
fi | ||
|
||
sleep 5 | ||
# Create the bucket | ||
if /opt/couchbase/bin/couchbase-cli bucket-list -c couchbase:8091 -u Administrator -p password | grep test > /dev/null; then | ||
echo "Bucket already created" | ||
exit 0 | ||
else | ||
echo "Creating bucket..." | ||
/opt/couchbase/bin/couchbase-cli bucket-create -c couchbase:8091 --username Administrator --password password --bucket test --bucket-type couchbase --bucket-ramsize 256 --enable-flush 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters