Skip to content

Commit

Permalink
Improve MTAR build process in Makefile
Browse files Browse the repository at this point in the history
 - Add variable for MTAR filename with versioning
 - Update build command to use the new MTAR_FILENAME variable
 - Change destination path for the built MTAR file
 - Fix typo in build message
  • Loading branch information
bonzofenix committed Nov 27, 2024
1 parent 80780c2 commit 5b5864a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/autoscaler/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aes_terminal_font_yellow := \e[38;2;255;255;0m
aes_terminal_reset := \e[0m
VERSION ?= 0.0.0-rc.1
DEST ?= build
MTAR_FILENAME ?= app-autoscaler-release-v$(VERSION).mtar

GO_VERSION = $(shell go version | sed -e 's/^[^0-9.]*\([0-9.]*\).*/\1/')
GO_DEPENDENCIES = $(shell find . -type f -name '*.go')
Expand Down Expand Up @@ -172,12 +173,12 @@ mta-logs:

.PHONY: mta-build
mta-build: mta-build-clean
@echo "bulding mtar file for version: $(VERSION)"
@echo "building mtar file for version: $(VERSION)"
cp mta.tpl.yaml mta.yaml
sed -i 's/VERSION/$(VERSION)/g' mta.yaml
mkdir -p $(DEST)
mbt build
@mv mta_archives/com.github.cloudfoundry.app-autoscaler-release_$(VERSION).mtar $(DEST)/app-autoscaler-release-v$(VERSION).mtar
mbt build -t /tmp --mtar $(MTAR_FILENAME)
@mv /tmp/$(MTAR_FILENAME) $(DEST)/$(MTAR_FILENAME)

mta-build-clean:
rm -rf mta_archives

0 comments on commit 5b5864a

Please sign in to comment.