Skip to content

Commit

Permalink
ci: stop bitcoind before exit (#202)
Browse files Browse the repository at this point in the history
* ci: stop bitcoind before exit

* ci: wait for pid to stop in CI

* fix: fix logical error

* refactor: add space after redirect

* ci: sleep for 10ms not 100ms

* fix: new image source

* fix: remove MVP link

* fix: duplicate broken link

* fix: remove another broken link
  • Loading branch information
epiccurious authored Dec 22, 2023
1 parent 4a62e0a commit c8644e6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Create a secure Bitcoin Core node with ease.

NOTE: This code is still under development and not yet ready. Test at your own risk. You can track progress under [the Minimum Viable Product milestone](https://github.com/epiccurious/bitcoin-core-node-builder/milestone/1).
NOTE: This code is still under development and not yet ready. Test at your own risk. You can track progress under the Minimum Viable Product milestone.

## Table of Contents

Expand All @@ -29,7 +29,7 @@ Open the Terminal and run the following command:
/bin/bash -c "$(curl -fsSL https://github.com/epiccurious/bitcoin-core-node-builder/raw/master/nodebuilder)"
```

NOTE: This code is still under development and not yet ready. Test at your own risk. You can track progress under [the Minimum Viable Product milestone](https://github.com/epiccurious/bitcoin-core-node-builder/milestone/1).
NOTE: This code is still under development and not yet ready. Test at your own risk. You can track progress under the Minimum Viable Product milestone.

## What Does This Script Do?

Expand Down
5 changes: 4 additions & 1 deletion nodebuilder
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ target_bitcoin_architecture="$(uname -m)"
temp_directory="$(mktemp -d)"
bitcoin_core_data_dir="${HOME}/.bitcoin"
user_data_dir="${XDG_DATA_HOME:-${HOME}/.local/share}"
shortcut_image_source="https://github.com/epiccurious/bitcoin-core-node-builder/raw/master/data/bitcoin.png"
shortcut_image_source="https://i.imgur.com/27V69CR.png"
shortcut_image_file="${user_data_dir}/images/bitcoin.png"

sleep_time="10"
Expand Down Expand Up @@ -360,6 +360,9 @@ while [ "${ibd_status}" = true ]; do

if [ "${CI:-false}" = true ] && [ "${size_on_disk_in_mib}" -ge 1 ]; then
echo "Exiting the script for CI runners."
bitcoin_pid="$(cat "${bitcoin_core_data_dir}"/bitcoind.pid)"
bitcoin-cli stop
while ps -p "${bitcoin_pid}"; do sleep 0.01; done &> /dev/null
exit 0
fi

Expand Down
2 changes: 1 addition & 1 deletion test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This page outlines the procedures to test `bitcoin-core-node-builder` scripts.

_**Before**_ opening a pull request, you must validate your changes against three third-party static analysis tools `ShellCheck`, `shfmt`, and `markdown-link-check`.

_**After**_ opening a pull request, GitHub Actions CI will [automatically run these tools](https://github.com/epiccurious/bitcoin-core-node-builder/actions/workflows/bash_validation_ci.yaml) for you.
_**After**_ opening a pull request, GitHub Actions CI will [automatically run these tools https github dot com/epiccurious/bitcoin-core-node-builder/actions/workflows/bash_validation_ci.yaml for you.

### Details About the Validation Tools

Expand Down

0 comments on commit c8644e6

Please sign in to comment.