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

Improve deploy scripts #342

Merged
merged 13 commits into from
Aug 22, 2022
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: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/hirsute64"
config.vm.box = "debian/bullseye64"

config.vm.provider "virtualbox" do |v|
v.memory = 1024 * 4
Expand Down
4 changes: 2 additions & 2 deletions deploy/bitcoind.service
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Wants=network-online.target

[Service]
ExecStart=/usr/local/bin/bitcoind \
-txindex \
-datadir=/var/lib/bitcoind \
-signet \
-datadir=/var/lib/bitcoind
-txindex

# Make sure the config directory is readable by the service user
PermissionsStartOnly=true
Expand Down
4 changes: 2 additions & 2 deletions deploy/ord.service
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Environment=RUST_BACKTRACE=1
Environment=RUST_LOG=info
ExecStart=/usr/local/bin/ord \
--cookie-file /var/lib/bitcoind/signet/.cookie \
--max-index-size 1TiB \
--rpc-url 127.0.0.1:38332 \
--data-dir /var/lib/ord \
--max-index-size 1TiB \
--network signet \
server \
--acme-cache /var/lib/ord/acme-cache \
--acme-contact mailto:casey@rodarmor.com \
Expand Down
11 changes: 6 additions & 5 deletions deploy/setup
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

set -euxo pipefail

apt-get update --yes
apt-get upgrade --yes
apt-get install --yes \
acl \
clang \
Expand All @@ -27,7 +25,9 @@ source ~/.cargo/env
rustup update stable

cargo build --release
mv /usr/local/bin/ord ord.old
if [[ -f /usr/local/bin/ord ]]; then
mv /usr/local/bin/ord /usr/local/bin/ord.bak
fi
cp target/release/ord /usr/local/bin/ord

id --user bitcoin || useradd --system bitcoin
Expand All @@ -50,10 +50,11 @@ setfacl -m ord:r /var/lib/bitcoind/signet/.cookie
cp deploy/ord.service /etc/systemd/system/
systemctl daemon-reload
systemctl stop ord
cp target/release/ord /usr/local/bin/ord
if [[ -f /var/lib/ord/signet/index.redb ]]; then
mv /var/lib/ord/signet/index.redb /var/lib/ord/signet/index.redb.bak
fi
systemctl enable ord
systemctl restart ord
rm ord.old

while ! curl --fail https://signet.ordinals.com/status; do
echo Waiting for ord…
Expand Down
10 changes: 8 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,19 @@ install-dev-deps:
cargo install cargo-criterion

deploy branch='master':
ssh root@signet.ordinals.com mkdir -p deploy
ssh root@signet.ordinals.com "mkdir -p deploy \
&& apt-get update --yes \
&& apt-get upgrade --yes \
&& apt-get install --yes git rsync"
rsync -avz deploy/checkout root@signet.ordinals.com:deploy/checkout
ssh root@signet.ordinals.com 'cd deploy && ./checkout {{branch}}'

log:
log-ord:
ssh root@signet.ordinals.com 'journalctl -fu ord'

log-bitcoind:
ssh root@signet.ordinals.com 'journalctl -fu bitcoind'

test-deploy:
ssh-keygen -f ~/.ssh/known_hosts -R 192.168.56.4
vagrant up
Expand Down