fix build with some features disabled

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino 2022-12-04 09:24:21 +01:00
parent 0f74c077ac
commit 9ba468698b
No known key found for this signature in database
GPG key ID: 935D2952DEC4EECF
5 changed files with 10 additions and 6 deletions

View file

@ -222,8 +222,8 @@ jobs:
name: sftpgo-${{ matrix.os }}-go-${{ matrix.go }} name: sftpgo-${{ matrix.os }}-go-${{ matrix.go }}
path: output path: output
test-bundle: test-build-flags:
name: Build in bundle mode name: Test build flags
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -236,6 +236,8 @@ jobs:
- name: Build - name: Build
run: | run: |
go build -trimpath -tags nopgxregisterdefaulttypes,nogcs,nos3,noportable,nobolt,nomysql,nopgsql,nosqlite,nometrics,noazblob -ldflags "-s -w -X github.com/drakkan/sftpgo/v2/internal/internal/version.commit=`git describe --always --abbrev=8 --dirty` -X github.com/drakkan/sftpgo/v2/internal/version.date=`date -u +%FT%TZ`" -o sftpgo
./sftpgo -v
cp -r openapi static templates internal/bundle/ cp -r openapi static templates internal/bundle/
go build -trimpath -tags nopgxregisterdefaulttypes,bundle -ldflags "-s -w -X github.com/drakkan/sftpgo/v2/internal/version.commit=`git describe --always --abbrev=8 --dirty` -X github.com/drakkan/sftpgo/v2/internal/version.date=`date -u +%FT%TZ`" -o sftpgo go build -trimpath -tags nopgxregisterdefaulttypes,bundle -ldflags "-s -w -X github.com/drakkan/sftpgo/v2/internal/version.commit=`git describe --always --abbrev=8 --dirty` -X github.com/drakkan/sftpgo/v2/internal/version.date=`date -u +%FT%TZ`" -o sftpgo
./sftpgo -v ./sftpgo -v

View file

@ -54,7 +54,6 @@ import (
const ( const (
azureDefaultEndpoint = "blob.core.windows.net" azureDefaultEndpoint = "blob.core.windows.net"
azBlobFsName = "AzureBlobFs"
azFolderKey = "hdi_isfolder" azFolderKey = "hdi_isfolder"
) )

View file

@ -45,7 +45,6 @@ import (
const ( const (
defaultGCSPageSize = 5000 defaultGCSPageSize = 5000
gcsfsName = "GCSFs"
) )
var ( var (

View file

@ -57,7 +57,6 @@ const (
// using this mime type for directories improves compatibility with s3fs-fuse // using this mime type for directories improves compatibility with s3fs-fuse
s3DirMimeType = "application/x-directory" s3DirMimeType = "application/x-directory"
s3TransferBufferSize = 256 * 1024 s3TransferBufferSize = 256 * 1024
s3fsName = "S3Fs"
) )
var ( var (

View file

@ -38,7 +38,12 @@ import (
"github.com/drakkan/sftpgo/v2/internal/util" "github.com/drakkan/sftpgo/v2/internal/util"
) )
const dirMimeType = "inode/directory" const (
dirMimeType = "inode/directory"
s3fsName = "S3Fs"
gcsfsName = "GCSFs"
azBlobFsName = "AzureBlobFs"
)
var ( var (
validAzAccessTier = []string{"", "Archive", "Hot", "Cool"} validAzAccessTier = []string{"", "Archive", "Hot", "Cool"}