Skip to content

Commit

Permalink
Build dqlite from specific tags (canonical#2929)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktsakalozos authored Feb 21, 2022
1 parent cafcae0 commit d5391b1
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ apps:
parts:
raft:
source: https://github.com/canonical/raft
source-tag: v0.11.3
build-attributes: [no-patchelf]
source-type: git
plugin: autotools
Expand Down Expand Up @@ -157,6 +158,7 @@ parts:
- raft
- sqlite
source: https://github.com/canonical/dqlite
source-tag: v1.9.1
build-attributes: [no-patchelf]
source-type: git
plugin: autotools
Expand All @@ -176,22 +178,29 @@ parts:
dqlite-client:
build-snaps: [go]
after: [sqlite, dqlite]
source: https://github.com/canonical/go-dqlite
source-type: git
plugin: go
go-channel: 1.15/stable
go-importpath: github.com/canonical/go-dqlite
source: build-scripts/
plugin: dump
override-build: |
set -eux
snap refresh go --channel=1.15/stable || true
go version
export TAG=v1.10.2
export GOPATH=${SNAPCRAFT_STAGE}
export CGO_CFLAGS="-I${SNAPCRAFT_STAGE}/usr/include/"
export CGO_LDFLAGS="-L${SNAPCRAFT_STAGE}/lib"
export CGO_LDFLAGS_ALLOW="-Wl,-z,now"
go get -tags libsqlite3 github.com/canonical/go-dqlite/cmd/dqlite
mkdir -p $SNAPCRAFT_PART_INSTALL/bin
cp $GOPATH/bin/dqlite $SNAPCRAFT_PART_INSTALL/bin/
mkdir -p $GOPATH/src/github.com/canonical/
(
cd $GOPATH/src/github.com/canonical/
rm -rf go-dqlite
git clone https://github.com/canonical/go-dqlite
cd go-dqlite
git checkout tags/"${TAG}" -b build
go build -v -tags libsqlite3 ./cmd/dqlite
cd ..
)
cp $GOPATH/src/github.com/canonical/go-dqlite/dqlite $SNAPCRAFT_PART_INSTALL/bin/
k8s-dqlite:
build-snaps: [go]
Expand Down

0 comments on commit d5391b1

Please sign in to comment.