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

Pass domain to deploy scripts #361

Merged
merged 2 commits into from
Aug 23, 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
9 changes: 5 additions & 4 deletions deploy/checkout
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

set -euxo pipefail

branch=$1
BRANCH=$1
DOMAIN=$2

if [[ ! -d ord ]]; then
git clone https://github.com/casey/ord.git
Expand All @@ -11,6 +12,6 @@ fi
cd ord

git fetch origin
git checkout -B $1
git reset --hard origin/$1
./deploy/setup
git checkout -B $BRANCH
git reset --hard origin/$BRANCH
./deploy/setup $DOMAIN
9 changes: 5 additions & 4 deletions deploy/setup
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ touch .hushlogin

sed -i -E 's/#?PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config

DOMAIN=$1

hostnamectl set-hostname $DOMAIN

apt-get install --yes \
acl \
clang \
Expand Down Expand Up @@ -55,13 +59,10 @@ setfacl -m ord:r /var/lib/bitcoind/signet/.cookie
cp deploy/ord.service /etc/systemd/system/
systemctl daemon-reload
systemctl stop 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

while ! curl --fail https://signet.ordinals.com/status; do
while ! curl --fail https://$DOMAIN/status; do
echo Waiting for ord…
sleep 1
done
15 changes: 7 additions & 8 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,18 @@ watch +args='test':
install-dev-deps:
cargo install cargo-criterion

deploy branch='master':
ssh root@signet.ordinals.com "mkdir -p deploy \
deploy branch domain:
ssh root@{{domain}} "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}}'
rsync -avz deploy/checkout root@{{domain}}:deploy/checkout
ssh root@{{domain}} 'cd deploy && ./checkout {{branch}} {{domain}}'

log-ord:
ssh [email protected] 'journalctl -fu ord'
deploy-signet branch="master": (deploy branch "signet.ordinals.com")

log-bitcoind:
ssh root@signet.ordinals.com 'journalctl -fu bitcoind'
log unit domain="signet.ordinals.com":
ssh root@{{domain}} 'journalctl -fu {{unit}}'

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