From 395f35fc3d4d2088f2c62bdb0fd2b71626de2016 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Tue, 2 Nov 2021 14:14:31 -0600 Subject: [PATCH] FB-904: Add deb/rpm packaging of FeatureBase binary --- .gitlab/.gitlab-ci.yml | 15 +++++++++++++++ Makefile | 8 ++++++++ nfpm.yaml | 15 +++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 nfpm.yaml diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 3ebd5d990..3afbafbdc 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -159,6 +159,21 @@ build for darwin arm64: paths: - featurebase_darwin_arm64 +package for linux amd64: + stage: build + image: registry.gitlab.com/molecula/featurebase/builder:0.0.3 + variables: + GOOS: "linux" + GOARCH: "amd64" + script: + - echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list + - apt update && apt install nfpm + - make package + artifacts: + paths: + - "*.deb" + - "*.rpm" + # Build a FB Docker image with CI/CD and push to the GitLab registry. build container fb: image: docker:stable diff --git a/Makefile b/Makefile index 130cae3ce..9878b09d8 100644 --- a/Makefile +++ b/Makefile @@ -44,6 +44,9 @@ clean: vendor: go.mod $(GO) mod vendor +version: + @echo $(VERSION) + # Run test suite test: $(GO) test ./... -tags='$(BUILD_TAGS) $(TEST_TAGS)' $(TESTFLAGS) -v @@ -126,6 +129,11 @@ release-sans-ui: check-clean $(MAKE) release-build GOOS=linux GOARCH=amd64 $(MAKE) release-build GOOS=linux GOARCH=arm64 +package: + go build -o featurebase ./cmd/featurebase + nfpm package --packager deb --target featurebase_$(VERSION_ID).deb + nfpm package --packager rpm --target featurebase_$(VERSION_ID).rpm + # try (e.g.) internal/clustertests/docker-compose-replication2.yml DOCKER_COMPOSE=internal/clustertests/docker-compose.yml diff --git a/nfpm.yaml b/nfpm.yaml new file mode 100644 index 000000000..636f5e03c --- /dev/null +++ b/nfpm.yaml @@ -0,0 +1,15 @@ +name: "featurebase" +arch: "${GOARCH}" +platform: "${GOOS}" +version: "${VERSION}" +section: "default" +priority: "extra" +maintainer: "Molecula Corp. " +description: "FeatureBase is a feature extraction and storage technology that enables real-time analytics." +vendor: "Molecula" +homepage: "https://molecula.com" +contents: + - src: ./featurebase + dst: /usr/local/bin/featurebase + - dst: /etc/featurebase.conf + type: ghost