Better installation script sftpgo.sh
This commit is contained in:
parent
38c23590da
commit
2c11085e5e
|
@ -1,22 +1,25 @@
|
||||||
#!/usr/bin/bash
|
#!/usr/bin/env bash
|
||||||
source /etc/os-release
|
source /etc/os-release
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
export GO=/usr/bin/go
|
# Download latest release
|
||||||
if [[ $ID = "debian" ]]; then
|
if [[ ! -d "sftpgo-src" ]]; then
|
||||||
export GO=/usr/lib/go-1.19/bin/go
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -d "sftpgo" ]]; then
|
|
||||||
git clone https://github.com/drakkan/sftpgo sftpgo-src
|
git clone https://github.com/drakkan/sftpgo sftpgo-src
|
||||||
fi
|
fi
|
||||||
cd sftpgo-src
|
cd sftpgo-src
|
||||||
|
git checkout main
|
||||||
git pull origin HEAD
|
git pull origin HEAD
|
||||||
git checkout $(git tag | tail -n 1)
|
git checkout $(git tag | tail -n 1)
|
||||||
|
|
||||||
|
# Prepare
|
||||||
cp -r openapi ./internal/bundle/openapi
|
cp -r openapi ./internal/bundle/openapi
|
||||||
cp -r templates ./internal/bundle/templates
|
cp -r templates ./internal/bundle/templates
|
||||||
cp -r static ./internal/bundle/static
|
cp -r static ./internal/bundle/static
|
||||||
$GO build -tags nogcs,nos3,noazblob,nobolt,nomysql,nopgsql,nosqlite,noportable,nometrics,bundle -o sftpgo
|
|
||||||
mv sftpgo /usr/local/bin/
|
# Build
|
||||||
|
go build -tags nogcs,nos3,noazblob,nobolt,nomysql,nopgsql,nosqlite,noportable,nometrics,bundle -o sftpgo
|
||||||
strip /usr/local/bin/sftpgo
|
strip /usr/local/bin/sftpgo
|
||||||
|
|
||||||
|
# Install
|
||||||
|
mv sftpgo /usr/local/bin/
|
||||||
|
|
Loading…
Reference in New Issue