deploy/install.sh

c6c5cb340929ee44650344d2fe40f5badb7bd65a
gitbay/deploy/install.sh

20 lines · 749 bytes · executable

 1#!/bin/sh
 2# Push the gitbayd binary to a freshly cloud-inited host and start it.
 3# Usage: deploy/install.sh <host-or-ip> [ssh-port]
 4set -eu
 5host=${1:?usage: install.sh <host-or-ip> [ssh-port]}
 6port=${2:-2222}
 7bin=dist/gitbayd-linux-amd64
 8
 9[ -f "$bin" ] || { echo "build first: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o $bin ./cmd/gitbayd" >&2; exit 1; }
10
11"$(dirname "$0")/copy.sh" "$host" "$port" "$bin" /usr/local/bin/gitbayd.new
12ssh -p "$port" "root@$host" '
13  set -eu
14  chmod 755 /usr/local/bin/gitbayd.new
15  mv /usr/local/bin/gitbayd.new /usr/local/bin/gitbayd
16  /usr/local/bin/gitbayd --config /etc/gitbay/config.toml check-config --no-host-checks
17  systemctl restart gitbayd
18  sleep 1
19  systemctl --no-pager --lines=5 status gitbayd
20'
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form