Skip to content

Commit

Permalink
Merge pull request #157 from Samourai-Wallet/feat_mydojo_cleanup
Browse files Browse the repository at this point in the history
clean-up of log files
  • Loading branch information
kenshin-samourai authored May 4, 2020
2 parents ccf3a41 + cfd2c33 commit 13e44e5
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
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
}

0 comments on commit 13e44e5

Please sign in to comment.