forked from singnet/das-poc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andre Senna
committed
Nov 18, 2022
1 parent
730092e
commit c7be706
Showing
8 changed files
with
175 additions
and
32 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
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
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,45 @@ | ||
#!/bin/bash | ||
|
||
setup() { | ||
local ATTEMPTS=$1 | ||
|
||
for attempt in $(seq 1 $ATTEMPTS); do | ||
echo "INFO: Waiting for Couchbase..." | ||
|
||
sleep 10 | ||
|
||
docker-compose exec couchbase couchbase-cli \ | ||
cluster-init \ | ||
--cluster-name DAS_Cluster \ | ||
--services "data","index","query" \ | ||
--cluster-index-ramsize 2048 \ | ||
--cluster-username "${DAS_DATABASE_USERNAME}" \ | ||
--cluster-password "${DAS_DATABASE_PASSWORD}" | ||
|
||
docker-compose exec couchbase couchbase-cli \ | ||
bucket-create \ | ||
-c localhost:8091 \ | ||
-u "${DAS_DATABASE_USERNAME}" \ | ||
-p "${DAS_DATABASE_PASSWORD}" \ | ||
--bucket das \ | ||
--bucket-type couchbase \ | ||
--bucket-ramsize "${DAS_COUCHBASE_BUCKET_RAMSIZE:-4086}" | ||
|
||
if [ "$?" == 0 ]; then | ||
echo "SUCCESS: Couchbase is ready." | ||
return | ||
fi | ||
|
||
echo "INFO: Couchbase is still being set up..." | ||
|
||
done | ||
|
||
echo "ERROR: Couchbase failed to be set up." | ||
return 1 | ||
} | ||
|
||
# Couchbase initial setup (attempts=5) | ||
setup 5 | ||
docker exec das_couchbase_1 mkdir /opt/couchbase_setup/new_das | ||
docker exec das_couchbase_1 chmod 777 /opt/couchbase_setup/new_das | ||
docker exec das_couchbase_1 couchbase_bucket_setup.sh & |
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