Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
davi17g committed Aug 4, 2024
1 parent 2adffa3 commit 205418b
Show file tree
Hide file tree
Showing 19 changed files with 24 additions and 537 deletions.
60 changes: 15 additions & 45 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
SHELL = bash

WORKSPACE = $(shell pwd)
UNAME = $(shell uname -sm | tr ' ' '-')
UNAME_M=$(shell uname -m)
MAINTAINER = "Aerospike <[email protected]>"
DESCRIPTION = "Aerospike Backup Service"
HOMEPAGE = "https://www.aerospike.com"
VENDOR = "Aerospike INC"
LICENSE = "Apache License 2.0"

BINARY_NAME=aerospike-backup-service
GIT_TAG = $(shell git describe --tags)
CMD_DIR = cmd/backup
TARGET_DIR = target
PACKAGES_DIR = packages
LIB_DIR = lib
PKG_DIR = build/package
PREP_DIR = $(TARGET_DIR)/pkg_install
CONFIG_FILES = $(wildcard config/*)
POST_INSTALL_SCRIPT = $(PKG_DIR)/post-install.sh
TOOLS_DIR = $(WORKSPACE)/modules/aerospike-tools-backup
ARCHS=linux/amd64 linux/arm64
PACKAGERS=deb rpm
TARGET=$(TARGET_DIR)/$(BINARY_NAME)
ifneq ($(strip $(OS))$(strip $(ARCH)),)
TARGET=$(TARGET_DIR)/$(BINARY_NAME)_$(OS)_$(ARCH)
endif


GIT_COMMIT:=$(shell git rev-parse HEAD)
VERSION:=$(shell cat VERSION)

Expand All @@ -35,20 +29,8 @@ GOBUILD = GOOS=$(OS) GOARCH=$(ARCH) $(GO) build \
-ldflags="-X main.commit=$(GIT_COMMIT) -X main.buildTime=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')"
GOTEST = $(GO) test
GOCLEAN = $(GO) clean
GO_VERSION = 1.22.5
GOBIN_VERSION = $(shell $(GO) version 2>/dev/null)


MAINTAINER = "Aerospike"
DESCRIPTION = "Aerospike Backup Service"
URL = "https://www.aerospike.com"
VENDOR = "Aerospike"
LICENSE = "Apache License 2.0"

.PHONY: install-deps
install-deps:
./scripts/install-deps.sh

.PHONY: prep-submodules
prep-submodules:
git submodule update --init --recursive
Expand Down Expand Up @@ -77,8 +59,15 @@ packages: buildx
OS=$$(echo $$arch | cut -d/ -f1); \
ARCH=$$(echo $$arch | cut -d/ -f2); \
OS=$$OS ARCH=$$ARCH \
NAME=$(BINARY_NAME) VERSION=$(VERSION) WORKSPACE=$(WORKSPACE) \
envsubst '$$OS $$ARCH $$NAME $$VERSION $$WORKSPACE' \
NAME=$(BINARY_NAME) \
VERSION=$(VERSION) \
WORKSPACE=$(WORKSPACE) \
MAINTAINER=$(MAINTAINER) \
DESCRIPTION=$(DESCRIPTION) \
HOMEPAGE=$(HOMEPAGE) \
VENDOR=$(VENDOR) \
LICENSE=$(LICENSE) \
envsubst '$$OS $$ARCH $$NAME $$VERSION $$WORKSPACE $$MAINTAINER $$DESCRIPTION $$HOMEPAGE $$VENDOR $$LICENSE' \
< $(PACKAGES_DIR)/nfpm.tmpl.yaml > $(PACKAGES_DIR)/nfpm-$$OS-$$ARCH.yaml; \
for packager in $(PACKAGERS); do \
$(NFPM) package \
Expand All @@ -99,30 +88,11 @@ checksums:
test:
$(GOTEST) -v ./...

.PHONY: rpm
rpm: tarball
mkdir -p $(WORKSPACE)/target
mkdir -p $(WORKSPACE)/packages/rpm/SOURCES
mv /tmp/$(BINARY_NAME)-$(VERSION)-$(UNAME_M).tar.gz $(WORKSPACE)/packages/rpm/SOURCES/
BINARY_NAME=$(BINARY_NAME) GIT_COMMIT=$(GIT_COMMIT) VERSION=$(VERSION) $(MAKE) -C packages/rpm

.PHONY: deb
deb: tarball
mkdir -p $(WORKSPACE)/target
mkdir -p $(WORKSPACE)/packages/deb/$(ARCH)
tar -xvf /tmp/$(BINARY_NAME)-$(VERSION)-$(UNAME_M).tar.gz -C $(WORKSPACE)/packages/deb/$(ARCH)
BINARY_NAME=$(BINARY_NAME) GIT_COMMIT=$(GIT_COMMIT) VERSION=$(VERSION) ARCH=$(ARCH) $(MAKE) -C packages/deb

.PHONY: tarball
tarball: prep-submodules
cd ./scripts && ./tarball.sh

.PHONY: release
release:
cd ./scripts && ./release.sh $(NEXT_VERSION)

.PHONY: clean
clean:
$(GOCLEAN)
$(MAKE) clean-submodules
rm -rf $(TARGET_DIR) $(LIB_DIR)
rm $(TARGET_DIR)/*
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.2
1.0.0
25 changes: 0 additions & 25 deletions packages/deb/Makefile

This file was deleted.

6 changes: 0 additions & 6 deletions packages/deb/debian/changelog

This file was deleted.

13 changes: 0 additions & 13 deletions packages/deb/debian/control

This file was deleted.

14 changes: 0 additions & 14 deletions packages/deb/debian/copyright

This file was deleted.

3 changes: 0 additions & 3 deletions packages/deb/debian/dirs

This file was deleted.

3 changes: 0 additions & 3 deletions packages/deb/debian/install

This file was deleted.

26 changes: 0 additions & 26 deletions packages/deb/debian/rules

This file was deleted.

1 change: 0 additions & 1 deletion packages/deb/debian/source/format

This file was deleted.

13 changes: 5 additions & 8 deletions packages/nfpm.tmpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ priority: "extra"
#conflicts:
#- not-foo
#- not-bar
maintainer: "Aerospike <[email protected]>"
description: |
Aerospike Backup Service
This package provides backup and restore capabilities
for Aerospike Database.!
vendor: "Aerospike INC"
homepage: "https://aerospike.com"
license: "Apache-2.0"
maintainer: "${MAINTAINER}"
description: "${DESCRIPTION}"
vendor: "${VENDOR}"
homepage: "${HOMEPAGE}"
license: "${LICENSE}"
#changelog: "changelog.yaml"
contents:
- src: ${WORKSPACE}/packages/config/${NAME}.service
Expand Down
23 changes: 0 additions & 23 deletions packages/rpm/Makefile

This file was deleted.

63 changes: 0 additions & 63 deletions packages/rpm/aerospike-backup-service.spec

This file was deleted.

66 changes: 0 additions & 66 deletions scripts/build-submodules.sh

This file was deleted.

Loading

0 comments on commit 205418b

Please sign in to comment.