Skip to content

Commit 9dbdd53

Browse files
authored
Merge pull request #492 from TarsCloud/perf/lbbniu/tarsgo
perf: makefile add upload and fix TARSBUILD
2 parents a8798a0 + 9a93d14 commit 9dbdd53

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

hack/scripts/makefile.tars.gomod.mk

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,16 @@ tar: $(TARGET) $(CONFIG)
9191
echo "tar cvfz $(TARGET).tgz ..."; \
9292
fi
9393

94+
TARS_WEB_HOST ?= http://localhost:3000
95+
TARS_WEB_TOKEN ?= ""
96+
UPLOAD_USER ?= $(shell whoami)
97+
UPLOAD_OS ?= linux
98+
upload: export GOOS=${UPLOAD_OS}
99+
upload: tar
100+
@echo "$(TARGET).tgz --- $(APP).$(TARGET).tgz OS: ${GOOS}"
101+
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}
102+
@echo "\n---------------------------------------------------------------------------\n"
103+
94104

95105
HELP += $(HELP_TAR)
96106

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

119129
help:
120-
@echo -e $(HELP)"\n"
130+
@echo $(HELP)"\n"
121131

122132
#-------------------------------------------------------------------------------
123133
tars2go:

tars/tools/tarsgo/internal/base/templates.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ make
6565
./{{.Server}} --config=config/config.conf
6666
`
6767

68-
makefileTemplateFile = "makefile"
68+
makefileTemplateFile = "Makefile"
6969
makefileTemplate = `APP := {{.App}}
7070
TARGET := {{.Server}}
7171
MFLAGS :=
@@ -283,5 +283,5 @@ func DoGenProject(p *Project, to string, mgrType string) error {
283283
if mgrType == consts.CMake {
284284
return bindata.RestoreAssets(to, "cmake")
285285
}
286-
return bindata.RestoreAsset(to, "scripts/makefile.tars.gomod")
286+
return bindata.RestoreAsset(to, "scripts/makefile.tars.gomod.mk")
287287
}

tars/tools/tarsgo/internal/bindata/bindata.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tars/tools/tarsgo/internal/consts/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package consts
33
// Release is the current tarsgo tool version.
44
const (
55
RepoURL = "https://github.com/TarsCloud/TarsGo.git"
6-
Release = "v1.3.5"
6+
Release = "v1.3.6"
77
MakeDemoDir = "Demo4GoMod"
88
//CMakeDemoDir = "Demo4Cmake"
99
Make = "make"

0 commit comments

Comments
 (0)