Skip to content

Commit

Permalink
Updating Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
carsso committed Jun 26, 2020
1 parent 8d7c570 commit 026213b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RPMROOT=rpms

ifdef REPOROOT
else
REPOROOT="/repo-root/"
REPOROOT="/repo-root"
endif

race_detector = GORACE="halt_on_error=1" go build -race
Expand All @@ -25,15 +25,14 @@ test: build = $(race_detector)

all: clean release

release: deps
release:
@mkdir -p release
@cp $(BASE_DIR)/src/wigo/global.go $(BASE_DIR)/src/wigo/global.go.bkp
@cd release && for target in $(RELEASE_TARGETS) ; do \
RELEASE_DIR=$(BASE_DIR)/release/$$target; \
sed -i "s/##VERSION##/Wigo v$(RELEASE_VERSION)/" $(BASE_DIR)/src/wigo/global.go;\
export CGO_ENABLED=1; \
export GOPATH=`echo "$(GOPATH):$(BASE_DIR)"`; \
echo $(GOPATH); \
export GOOS=`echo $$target | cut -d "-" -f 1`; \
export GOARCH=`echo $$target | cut -d "-" -f 2`; \
if [ $$target = 'linux-arm' ]; then \
Expand All @@ -52,7 +51,7 @@ release: deps
done
@rm $(BASE_DIR)/src/wigo/global.go.bkp

debs: release
debs:
@mkdir -p $(DEBROOT)
@mkdir -p $(DEBROOT)/etc/wigo/conf.d
@mkdir -p $(DEBROOT)/etc/logrotate.d
Expand Down Expand Up @@ -87,11 +86,11 @@ debs: release
dpkg-deb --build $(DEBROOT) $(DEBROOT)/wigo-$(RELEASE_VERSION)-$$arch.deb ; \
done

publish-debs: debs
publish-debs:
@for arch in amd64 armhf ; do \
for release in stretch buster ; do \
echo "Adding package with arch $$arch and release $$release to repo" ; \
reprepro --ask-passphrase -b $(DEBMIRRORROOT) includedeb $$release $(DEBROOT)/wigo-$(RELEASE_VERSION)-$$arch.deb ; \
reprepro --ask-passphrase -b $(REPOROOT) includedeb $$release $(DEBROOT)/wigo-$(RELEASE_VERSION)-$$arch.deb ; \
done \
done

Expand All @@ -109,4 +108,5 @@ clean:
@rm -rf $(DEBROOT)

deps:
@go get -d ./...
@export GOPATH=`echo "$(GOPATH):$(BASE_DIR)"`; \
go get -d ./...

0 comments on commit 026213b

Please sign in to comment.