Skip to content

Commit

Permalink
Merge pull request #492 from TarsCloud/perf/lbbniu/tarsgo
Browse files Browse the repository at this point in the history
perf: makefile add upload and fix TARSBUILD
  • Loading branch information
lbbniu authored Jun 26, 2023
2 parents a8798a0 + 9a93d14 commit 9dbdd53
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 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.

2 changes: 1 addition & 1 deletion tars/tools/tarsgo/internal/consts/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package consts
// Release is the current tarsgo tool version.
const (
RepoURL = "https://github.com/TarsCloud/TarsGo.git"
Release = "v1.3.5"
Release = "v1.3.6"
MakeDemoDir = "Demo4GoMod"
//CMakeDemoDir = "Demo4Cmake"
Make = "make"
Expand Down

0 comments on commit 9dbdd53

Please sign in to comment.