Skip to content

Commit

Permalink
perf: makefile add upload and fix TARSBUILD
Browse files Browse the repository at this point in the history
  • Loading branch information
lbbniu committed Jun 26, 2023
1 parent a8798a0 commit fdf7706
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
12 changes: 11 additions & 1 deletion hack/scripts/makefile.tars.gomod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ tar: $(TARGET) $(CONFIG)
echo "tar cvfz $(TARGET).tgz ..."; \
fi

TARS_WEB_HOST ?= http://localhost:3000
TARS_WEB_TOKEN ?= ""
UPLOAD_USER ?= $(shell whoami)
UPLOAD_OS ?= linux
upload: export GOOS=${UPLOAD_OS}
upload: tar
@echo "$(TARGET).tgz --- $(APP).$(TARGET).tgz OS: ${GOOS}"
curl ${TARS_WEB_HOST}/api/upload_and_publish?ticket=${TARS_WEB_TOKEN} -Fsuse=@${TARGET}.tgz -Fapplication=${APP} -Fmodule_name=${TARGET} -Fcomment=uploaded-by-${UPLOAD_USER}
@echo "\n---------------------------------------------------------------------------\n"


HELP += $(HELP_TAR)

Expand All @@ -117,7 +127,7 @@ HELP_CLEANALL = "\n\033[1;33mcleanall\033[0m:\t[clean & rm .*.d]"
HELP_TAR = "\n\033[1;33mtar\033[0m:\t\t[will do 'tar $(TARGET).tgz $(RELEASE_FILE)']"

help:
@echo -e $(HELP)"\n"
@echo $(HELP)"\n"

#-------------------------------------------------------------------------------
tars2go:
Expand Down
4 changes: 2 additions & 2 deletions tars/tools/tarsgo/internal/base/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ make
./{{.Server}} --config=config/config.conf
`

makefileTemplateFile = "makefile"
makefileTemplateFile = "Makefile"
makefileTemplate = `APP := {{.App}}
TARGET := {{.Server}}
MFLAGS :=
Expand Down Expand Up @@ -283,5 +283,5 @@ func DoGenProject(p *Project, to string, mgrType string) error {
if mgrType == consts.CMake {
return bindata.RestoreAssets(to, "cmake")
}
return bindata.RestoreAsset(to, "scripts/makefile.tars.gomod")
return bindata.RestoreAsset(to, "scripts/makefile.tars.gomod.mk")
}
6 changes: 3 additions & 3 deletions tars/tools/tarsgo/internal/bindata/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fdf7706

Please sign in to comment.