lbry-docker/chainquery/quick-bootstrap.sh

88 lines
2.3 KiB
Bash
Raw Normal View History

Chainquery works mostly and so does lbrycrd Merge branch 'master' of github.com:lbryio/lbry-docker Starting on a .travis.yml but may be unnecessary Renamed www.spee.ch and lbrynet-daemon to reflect their upstream repos. Disabled Adminer Started debug for chainquery container. Get latest release tagged url from github API remove zip.zip maybe? debugging curl explicit unzip Adding -o for unzip simplified, removed debug and fixed curl reverted to original unzip function Pull chainquery from prep container passing alternative config path Aligned config path location with linux spec updated config location maybe don't be as explicit adding debug for chainqueryconfig.toml Fixes magicless chainquery and starts on bootstrap added chainquery/.gitignore to ignore large blobs. fixed Dockerfile up to use staged prep and production removed db-seed.sh as we have quick-bootstrap.sh start.sh needed modification to pull config from the right location in the linux FS Added chainquery/.dockerignore to prevent extremely long build times in the future Removed fancy bash vars in chainquery/.env Started work on getting quick-bootstrap.sh ready for release. Switch to lbrynet network Switched network name to lbrynet Merge branch 'leopere' of github.com:lbryio/lbry-docker into leopere Remove debugging access port bind Expose chainquery to the internet Merge branch 'leopere' of github.com:lbryio/lbry-docker into leopere Removed now unnecessary run command Undo Cleanup and commenting on environment variables Start getting ready for adding chainquery start.sh magic Quick update
2018-11-05 04:42:35 +01:00
#!/usr/bin/env bash
## Be Polite and ask for permission.
function QandA() {
read -r -p "Continue with $1 [y/N] " response
response=${response,,} # tolower
if [[ "$response" =~ ^(yes|y)$ ]]; then
echo "Continuing with this."
eval $1
else
echo "Skipping the $1."
fi
}
## Check your $PATH for required dependencies.
## Stop and complain for now, later automagically install them.
function test_for_deps() {
## Test for Command
if ! [ -x "$(command -v $1)" ]; then
echo "Error: $1 is not installed." >&2
echo "You must have $1 installed."
else
echo "Info: $1 is installed."
fi
}
## Declare Linux app dependencies to check for.
DEPENDENCIES=(
wget
unzip
docker
)
## Recommended.
BONUS_DEPENDENCIES=(
docker-compose
)
function check_deps() {
for i in "${!DEPENDENCIES[@]}"; do
echo ${DEPENDENCIES[$i]}"_KEY"
## Indirect references http://tldp.org/LDP/abs/html/ivr.html
eval TESTDEP=\$"${DEPENDENCIES[$i]}"
test_for_deps $TESTDEP
done
}
## Add ways to get into and out of a bind here.
case $1 in
getdata )
## Get DB Checkpoint data.
2018-11-06 21:13:56 +01:00
axel -a -n 6 http://chainquery-data.s3.amazonaws.com/chainquery-data.zip -o ./chainquery.zip
Chainquery works mostly and so does lbrycrd Merge branch 'master' of github.com:lbryio/lbry-docker Starting on a .travis.yml but may be unnecessary Renamed www.spee.ch and lbrynet-daemon to reflect their upstream repos. Disabled Adminer Started debug for chainquery container. Get latest release tagged url from github API remove zip.zip maybe? debugging curl explicit unzip Adding -o for unzip simplified, removed debug and fixed curl reverted to original unzip function Pull chainquery from prep container passing alternative config path Aligned config path location with linux spec updated config location maybe don't be as explicit adding debug for chainqueryconfig.toml Fixes magicless chainquery and starts on bootstrap added chainquery/.gitignore to ignore large blobs. fixed Dockerfile up to use staged prep and production removed db-seed.sh as we have quick-bootstrap.sh start.sh needed modification to pull config from the right location in the linux FS Added chainquery/.dockerignore to prevent extremely long build times in the future Removed fancy bash vars in chainquery/.env Started work on getting quick-bootstrap.sh ready for release. Switch to lbrynet network Switched network name to lbrynet Merge branch 'leopere' of github.com:lbryio/lbry-docker into leopere Remove debugging access port bind Expose chainquery to the internet Merge branch 'leopere' of github.com:lbryio/lbry-docker into leopere Removed now unnecessary run command Undo Cleanup and commenting on environment variables Start getting ready for adding chainquery start.sh magic Quick update
2018-11-05 04:42:35 +01:00
;;
extract )
## Unpack the data again if need be.
unzip ./chainquery.zip
;;
cleanup )
## Remove any junk here.
rm chainquery.zip
;;
reset )
## Give up on everything and try again.
# rm -Rf ./data
# rm -f ./chainquery.zip
;;
2018-11-06 21:32:38 +01:00
compress-latest-checkpoint-data )
## This is not intended for public use.
2018-11-06 21:11:20 +01:00
docker-compose stop chainquery
docker-compose stop mysql
2018-11-06 21:32:38 +01:00
sudo zip -r chainquery-data.zip data
docker-compose up -d mysql
sleep 30
docker-compose up -d chainquery
;;
upload-latest-checkpoint-data )
## This is not intended for public use.
2018-11-06 21:11:20 +01:00
aws s3 cp ./chainquery-data.zip s3://chainquery-data/chainquery-data.new
aws s3 rm s3://chainquery-data/chainquery-data.zip
aws s3 mv s3://chainquery-data/chainquery-data.new s3://chainquery-data/chainquery-data.zip
2018-11-06 21:19:50 +01:00
;;
Chainquery works mostly and so does lbrycrd Merge branch 'master' of github.com:lbryio/lbry-docker Starting on a .travis.yml but may be unnecessary Renamed www.spee.ch and lbrynet-daemon to reflect their upstream repos. Disabled Adminer Started debug for chainquery container. Get latest release tagged url from github API remove zip.zip maybe? debugging curl explicit unzip Adding -o for unzip simplified, removed debug and fixed curl reverted to original unzip function Pull chainquery from prep container passing alternative config path Aligned config path location with linux spec updated config location maybe don't be as explicit adding debug for chainqueryconfig.toml Fixes magicless chainquery and starts on bootstrap added chainquery/.gitignore to ignore large blobs. fixed Dockerfile up to use staged prep and production removed db-seed.sh as we have quick-bootstrap.sh start.sh needed modification to pull config from the right location in the linux FS Added chainquery/.dockerignore to prevent extremely long build times in the future Removed fancy bash vars in chainquery/.env Started work on getting quick-bootstrap.sh ready for release. Switch to lbrynet network Switched network name to lbrynet Merge branch 'leopere' of github.com:lbryio/lbry-docker into leopere Remove debugging access port bind Expose chainquery to the internet Merge branch 'leopere' of github.com:lbryio/lbry-docker into leopere Removed now unnecessary run command Undo Cleanup and commenting on environment variables Start getting ready for adding chainquery start.sh magic Quick update
2018-11-05 04:42:35 +01:00
* )
echo "=================================================="
echo "You look like you need usage examples let me help."
echo "=================================================="
echo "Add documentation on script params HERE"
;;
esac