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

Fix deploy setup script #2829

Merged
merged 12 commits into from
Dec 8, 2023
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
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ members = [".", "test-bitcoincore-rpc", "crates/*"]
[dependencies]
anyhow = { version = "1.0.56", features = ["backtrace"] }
async-trait = "0.1.72"
axum = { version = "0.6.1", features = ["headers"] }
axum = { version = "0.6.1", features = ["headers", "http2"] }
axum-server = "0.5.0"
base64 = "0.21.0"
bech32 = "0.9.1"
Expand All @@ -39,7 +39,7 @@ futures = "0.3.21"
hex = "0.4.3"
html-escaper = "0.2.0"
http = "0.2.6"
hyper = { version = "0.14.24", features = ["http1", "client"] }
hyper = { version = "0.14.24", features = ["client", "http2"] }
indicatif = "0.17.1"
lazy_static = "1.4.0"
log = "0.4.14"
Expand Down
12 changes: 7 additions & 5 deletions deploy/checkout
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
set -euxo pipefail

BRANCH=$1
CHAIN=$2
DOMAIN=$3
REMOTE=$2
CHAIN=$3
DOMAIN=$4

if [[ ! -d ord ]]; then
git clone https://github.com/ordinals/ord.git
if [[ ! -d $REMOTE ]]; then
mkdir -p $REMOTE
git clone https://github.com/$REMOTE.git $REMOTE
fi

cd ord
cd $REMOTE

git fetch origin
git checkout -B $BRANCH
Expand Down
5 changes: 3 additions & 2 deletions deploy/setup
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env bash

# This script is idempotent in the sense that running it more
# than once will not change the state beyond the initial application
# This script is idempotent.

set -euxo pipefail

Expand Down Expand Up @@ -32,8 +31,10 @@ hostnamectl set-hostname $DOMAIN
apt-get install --yes \
acl \
clang \
curl \
libsqlite3-dev\
libssl-dev \
locales-all \
pkg-config \
ufw \
vim
Expand Down
14 changes: 8 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,25 @@ clippy:
lclippy:
cargo lclippy --all --all-targets -- -D warnings

deploy branch chain domain:
deploy branch remote chain 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@{{domain}}:deploy/checkout
ssh root@{{domain}} 'cd deploy && ./checkout {{branch}} {{chain}} {{domain}}'
ssh root@{{domain}} 'cd deploy && ./checkout {{branch}} {{remote}} {{chain}} {{domain}}'

deploy-all: deploy-testnet deploy-signet deploy-mainnet

deploy-mainnet branch="master": (deploy branch "main" "ordinals.net")
deploy-mainnet-balance branch="master" remote="ordinals/ord": (deploy branch "main" "balance.ordinals.net")

deploy-signet branch="master": (deploy branch "signet" "signet.ordinals.net")
deploy-mainnet-equilibrium branch="master" remote="ordinals/ord": (deploy branch "main" "equilibrium.ordinals.net")

deploy-testnet branch="master": (deploy branch "test" "testnet.ordinals.net")
deploy-mainnet-stability branch="master" remote="ordinals/ord": (deploy branch "main" "stability.ordinals.net")

deploy-ord-dev branch="master" chain="main" domain="ordinals-dev.com": (deploy branch chain domain)
deploy-signet branch="master" remote="ordinals/ord": (deploy branch remote "signet" "signet.ordinals.net")

deploy-testnet branch="master" remote="ordinals/ord": (deploy branch remote "test" "testnet.ordinals.net")

save-ord-dev-state domain="ordinals-dev.com":
$EDITOR ./deploy/save-ord-dev-state
Expand Down
Loading