Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clean-up of log files #157

Merged
merged 1 commit into from
May 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docker/my-dojo/dojo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ upgrade() {
fi
# Start Dojo
docker_up --remove-orphans
# Post start clean-up
post_start_cleanup
# Update the database
update_dojo_db
# Display the logs
Expand Down
48 changes: 48 additions & 0 deletions docker/my-dojo/install/upgrade-scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,40 @@ update_dojo_db() {

# Clean-up
cleanup() {
#################
# Clean-up v1.6.0
#################

# Remove docker volume my-dojo_data-explorer
explorerVolumeFound=$(docker volume ls | grep my-dojo_data-explorer | wc -l)
if [ $explorerVolumeFound -ne 0 ]; then
explorerContainerFound=$(docker container ls -a | grep explorer | wc -l)
if [ $explorerContainerFound -ne 0 ]; then
docker container rm explorer
fi
docker volume rm my-dojo_data-explorer
fi

# Remove docker volume my-dojo_data-nginx
nginxVolumeFound=$(docker volume ls | grep my-dojo_data-nginx | wc -l)
if [ $nginxVolumeFound -ne 0 ]; then
nginxContainerFound=$(docker container ls -a | grep nginx | wc -l)
if [ $nginxContainerFound -ne 0 ]; then
docker container rm nginx
fi
docker volume rm my-dojo_data-nginx
fi

# Remove docker volume my-dojo_data-nodejs
nodeVolumeFound=$(docker volume ls | grep my-dojo_data-nodejs | wc -l)
if [ $nodeVolumeFound -ne 0 ]; then
nodeContainerFound=$(docker container ls -a | grep nodejs | wc -l)
if [ $nodeContainerFound -ne 0 ]; then
docker container rm nodejs
fi
docker volume rm my-dojo_data-nodejs
fi

#################
# Clean-up v1.3.0
#################
Expand All @@ -147,3 +181,17 @@ cleanup() {
fi

}

# Post start clean-up
post_start_cleanup() {
#################
# Clean-up v1.6.0
#################

# Remove debug.log from bitcoind volume
if [ "$COMMON_BTC_NETWORK" == "testnet" ]; then
docker exec -it bitcoind rm /home/bitcoin/.bitcoin/testnet3/debug.log
else
docker exec -it bitcoind rm /home/bitcoin/.bitcoin/debug.log
fi
}