forked from ordinals/ord
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to deploy dev server on production machines (ordinals#550)
- Loading branch information
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euxo pipefail | ||
|
||
mkdir -p /etc/systemd/system/ord-dev.service.d | ||
|
||
cp /etc/systemd/system/{ord,ord-dev}.service.d/override.conf | ||
|
||
cargo build --release | ||
|
||
if [[ -f /usr/local/bin/ord-dev ]]; then | ||
mv /usr/local/bin/ord-dev{,.bak} | ||
fi | ||
|
||
cp target/release/ord /usr/local/bin/ord-dev | ||
|
||
cp deploy/ord-dev.service /etc/systemd/system/ | ||
systemctl daemon-reload | ||
systemctl restart ord-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
[Unit] | ||
After=network.target | ||
Description=Ord Dev Server | ||
StartLimitBurst=120 | ||
StartLimitIntervalSec=10m | ||
|
||
[Service] | ||
AmbientCapabilities=CAP_NET_BIND_SERVICE | ||
Environment=RUST_BACKTRACE=1 | ||
Environment=RUST_LOG=info | ||
ExecStart=/usr/local/bin/ord-dev \ | ||
--bitcoin-data-dir /var/lib/bitcoind \ | ||
--data-dir /var/lib/ord-dev \ | ||
--chain ${CHAIN} \ | ||
server \ | ||
--http-port 8080 | ||
Group=ord | ||
MemoryDenyWriteExecute=true | ||
NoNewPrivileges=true | ||
PrivateDevices=true | ||
PrivateTmp=true | ||
ProtectHome=true | ||
ProtectSystem=full | ||
Restart=on-failure | ||
RestartSec=5s | ||
StateDirectory=ord-dev | ||
StateDirectoryMode=0700 | ||
TimeoutStopSec=10m | ||
Type=simple | ||
User=ord | ||
WorkingDirectory=/var/lib/ord-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters