Build peach-go-ssb-room package
This commit is contained in:
parent
62d791f29a
commit
06f3bd5702
|
@ -2,10 +2,12 @@
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# create user which go-ssb-room runs as
|
# create user which go-ssb-room runs as
|
||||||
adduser --quiet --system peach-go-ssb-room
|
adduser --system --quiet --home /var/lib/go-ssb-room peach-go-ssb-room
|
||||||
|
mkdir -p /var/lib/peachcloud/go-ssb-room
|
||||||
|
|
||||||
# set permissions
|
# set permissions
|
||||||
chown peach-go-ssb-room /usr/bin/go-ssb-room-server
|
chown peach-go-ssb-room /var/lib/peachcloud/go-ssb-room
|
||||||
|
chown peach-go-ssb-room /usr/bin/go-ssb-room
|
||||||
|
|
||||||
# Automatically added by cargo-deb
|
# Automatically added by cargo-deb
|
||||||
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
|
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=peachs go-sbot
|
Description="peach-go-ssb-room service"
|
||||||
|
After=network.target
|
||||||
|
After=nginx.target
|
||||||
|
Wants=nginx.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
# TODO: dynamically replace roomtest2.commoninternet.net
|
||||||
User=peach-go-ssb-room
|
ExecStart=/usr/bin/go-ssb-room -repo /var/lib/peachcloud/go-ssb-room -lishttp localhost:8899 -https-domain roomtest2.commoninternet.net
|
||||||
Environment="GO_HTTPS_DOMAIN=littleorchard.dyn.peachcloud.org"
|
WorkingDirectory=/var/lib/peachcloud/go-ssb-room
|
||||||
ExecStart=/usr/bin/go-ssb-room-server -https-domain "$GO_HTTPS_DOMAIN" -lishttp ":3001" -lismux ":8009"
|
|
||||||
Restart=always
|
Restart=always
|
||||||
|
SyslogIdentifier=gossbroom
|
||||||
|
User=peach-go-ssb-room
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
|
@ -15,7 +15,7 @@ from peach_package_builder.utils import render_template, add_deb_to_freight, upd
|
||||||
|
|
||||||
# manually update this version when we want to build a new peach-go-sbot package
|
# manually update this version when we want to build a new peach-go-sbot package
|
||||||
PEACH_GO_SBOT_VERSION = '0.1.5'
|
PEACH_GO_SBOT_VERSION = '0.1.5'
|
||||||
PEACH_GO_SSB_ROOM_VERSION = '0.1.7'
|
PEACH_GO_SSB_ROOM_VERSION = '0.1.12'
|
||||||
|
|
||||||
|
|
||||||
def crosscompile_peach_go_sbot(src_dir):
|
def crosscompile_peach_go_sbot(src_dir):
|
||||||
|
@ -32,6 +32,10 @@ def crosscompile_peach_go_ssb_room(src_dir):
|
||||||
subprocess.check_call(["env", "CGO_ENABLED=1", "CC=aarch64-linux-gnu-gcc",
|
subprocess.check_call(["env", "CGO_ENABLED=1", "CC=aarch64-linux-gnu-gcc",
|
||||||
"CC_FOR_TARGET=gcc-aarch64-linux-gnu", "GOOS=linux",
|
"CC_FOR_TARGET=gcc-aarch64-linux-gnu", "GOOS=linux",
|
||||||
"GOARCH=arm64", "go", "build", "./cmd/server"], cwd=src_dir)
|
"GOARCH=arm64", "go", "build", "./cmd/server"], cwd=src_dir)
|
||||||
|
print("[CROSS-COMPILING go-ssb-room/insert-user]")
|
||||||
|
subprocess.check_call(["env", "CGO_ENABLED=1", "CC=aarch64-linux-gnu-gcc",
|
||||||
|
"CC_FOR_TARGET=gcc-aarch64-linux-gnu", "GOOS=linux",
|
||||||
|
"GOARCH=arm64", "go", "build", "./cmd/insert-user"], cwd=src_dir)
|
||||||
|
|
||||||
|
|
||||||
def package_go_package(src_dir, package_name, deb_conf_dir, build_dir, go_binary_names, version):
|
def package_go_package(src_dir, package_name, deb_conf_dir, build_dir, go_binary_names, version):
|
||||||
|
@ -122,7 +126,7 @@ def build_peach_go_ssb_room():
|
||||||
DEB_BUILD_DIR = "/tmp/peach_go_ssb_room"
|
DEB_BUILD_DIR = "/tmp/peach_go_ssb_room"
|
||||||
# GO_BINARIES is a list of tuples of src_name and dest_name,
|
# GO_BINARIES is a list of tuples of src_name and dest_name,
|
||||||
# which will be callable via /usr/bin/dest_name after installation
|
# which will be callable via /usr/bin/dest_name after installation
|
||||||
GO_BINARIES = [('server', 'go-ssb-room-server')]
|
GO_BINARIES = [('server', 'go-ssb-room'), ('insert-user', 'go-ssb-room-insert-user')]
|
||||||
SRC_DIR = "/srv/peachcloud/automation/go-ssb-room"
|
SRC_DIR = "/srv/peachcloud/automation/go-ssb-room"
|
||||||
|
|
||||||
# gets the most recently built peach_go_sbot version, and increments the micro-number by 1
|
# gets the most recently built peach_go_sbot version, and increments the micro-number by 1
|
||||||
|
@ -145,6 +149,6 @@ def build_peach_go_ssb_room():
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# build_peach_go_sbot()
|
build_peach_go_sbot()
|
||||||
build_peach_go_ssb_room()
|
build_peach_go_ssb_room()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue