From 8ec584c86f538b60fdc18e12c3935158ae5fcf47 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Fri, 8 Dec 2023 17:11:24 -0500 Subject: [PATCH] Allow deploying remotes other than ordinals/ord (#2829) --- Cargo.toml | 4 ++-- deploy/checkout | 12 +++++++----- deploy/setup | 5 +++-- justfile | 14 ++++++++------ 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 21574b66fc..8c790562f9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" @@ -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" diff --git a/deploy/checkout b/deploy/checkout index b5707fd378..aba9e9b0ab 100755 --- a/deploy/checkout +++ b/deploy/checkout @@ -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 diff --git a/deploy/setup b/deploy/setup index b3f3c51603..7b41feb589 100755 --- a/deploy/setup +++ b/deploy/setup @@ -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 @@ -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 diff --git a/justfile b/justfile index 61f8d59481..32431b72ee 100644 --- a/justfile +++ b/justfile @@ -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