-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: modify the dockerfile and bootup logic
Signed-off-by: Phoeniix Zhao <[email protected]>
- Loading branch information
1 parent
844fc53
commit a514acf
Showing
4 changed files
with
59 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
if [ -z "$HOSTNAME" ]; then | ||
echo -e "Env HOSTNAME is not set" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "$MEMBERS" ]; then | ||
echo -e "Env MEMBERS is not set" | ||
exit 1 | ||
fi | ||
|
||
RUST_LOG="${RUST_LOG:-debug}" | ||
ENGINE="${STORAGE_ENGINE:-rocksdb}" | ||
DATA_DIR="${DATA_DIR:-/usr/local/xline/data-dir}" | ||
PUBLIC_KEY="${PUBLIC_KEY:-/mnt/public.pem}" | ||
PRIVATE_KEY="${PRIVATE_KEY:-/mnt/private.pem}" | ||
|
||
if [ -z "$IS_LEADER" ]; then | ||
RUST_LOG=$RUST_LOG /usr/local/bin/xline \ | ||
--name $HOSTNAME \ | ||
--members $MEMBERS \ | ||
--storage-engine rocksdb \ | ||
--data-dir /usr/local/xline/data-dir \ | ||
--auth-public-key /mnt/public.pem \ | ||
--auth-private-key /mnt/private.pem | ||
else | ||
RUST_LOG=$RUST_LOG /usr/local/bin/xline \ | ||
--name $HOSTNAME \ | ||
--members $MEMBERS \ | ||
--storage-engine rocksdb \ | ||
--data-dir /usr/local/xline/data-dir \ | ||
--auth-public-key /mnt/public.pem \ | ||
--auth-private-key /mnt/private.pem \ | ||
--is-leader | ||
fi |