Code Review
/
src
/
xds
/
xds-agent.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fixed webapp build error in prod mode
[src/xds/xds-agent.git]
/
Makefile
diff --git
a/Makefile
b/Makefile
index
dd5294c
..
dc185a7
100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-95,7
+95,10
@@
endif
ifeq ($(SUB_VERSION), )
PACKAGE_ZIPFILE := $(TARGET)_$(ARCH)-$(VERSION).zip
else
ifeq ($(SUB_VERSION), )
PACKAGE_ZIPFILE := $(TARGET)_$(ARCH)-$(VERSION).zip
else
- PACKAGE_ZIPFILE := $(TARGET)_$(ARCH)-$(VERSION)_$(SUB_VERSION).zip
+ # only use dot as separator to allow rpm packaging (see version .spec file)
+ PK_VER := $(subst _,.,$(subst -,,$(VERSION)))
+ PK_SBVER := $(subst _,.,$(subst -,,$(SUB_VERSION)))
+ PACKAGE_ZIPFILE := $(TARGET)_$(ARCH)-$(PK_VER).$(PK_SBVER).zip
endif
endif
@@
-129,16
+132,24
@@
clean:
.PHONY: distclean
distclean: clean
.PHONY: distclean
distclean: clean
- cd $(ROOT_SRCDIR) && rm -rf $(LOCAL_BINDIR) ./tools ./glide.lock ./vendor ./*.zip ./webapp/node_modules ./webapp/dist
+ (cd $(ROOT_SRCDIR) && rm -rf $(LOCAL_BINDIR) ./tools ./glide.lock ./vendor ./*.zip ./webapp/dist ./webapp/node_modules)
webapp: webapp/install
webapp: webapp/install
+ifneq ($(SKIP_WEBAPP_BUILD), true)
cd webapp && npm run $(WEBAPP_BUILD_RULE)
cd webapp && npm run $(WEBAPP_BUILD_RULE)
+else
+ @echo "Skipping webapp build (SKIP_WEBAPP_BUILD var is set)"
+endif
webapp/debug:
cd webapp && npm run watch
webapp/install:
webapp/debug:
cd webapp && npm run watch
webapp/install:
+ifneq ($(SKIP_WEBAPP_BUILD), true)
(cd webapp && npm install)
(cd webapp && npm install)
+else
+ @echo "Skipping webapp install (SKIP_WEBAPP_BUILD var is set)"
+endif
@if [ -d ${DESTDIR}/usr/local/etc ]; then rm -rf ${DESTDIR}/usr; fi
.PHONY: install
@if [ -d ${DESTDIR}/usr/local/etc ]; then rm -rf ${DESTDIR}/usr; fi
.PHONY: install
@@
-167,9
+178,9
@@
package-all:
@echo "# Build linux amd64..."
GOOS=linux GOARCH=amd64 RELEASE=1 make -f $(ROOT_SRCDIR)/Makefile package
@echo "# Build windows amd64..."
@echo "# Build linux amd64..."
GOOS=linux GOARCH=amd64 RELEASE=1 make -f $(ROOT_SRCDIR)/Makefile package
@echo "# Build windows amd64..."
- GOOS=windows GOARCH=amd64 RELEASE=1 make -f $(ROOT_SRCDIR)/Makefile package
+ GOOS=windows GOARCH=amd64 RELEASE=1
SKIP_WEBAPP_BUILD=true
make -f $(ROOT_SRCDIR)/Makefile package
@echo "# Build darwin amd64..."
@echo "# Build darwin amd64..."
- GOOS=darwin GOARCH=amd64 RELEASE=1 make -f $(ROOT_SRCDIR)/Makefile package
+ GOOS=darwin GOARCH=amd64 RELEASE=1
SKIP_WEBAPP_BUILD=true
make -f $(ROOT_SRCDIR)/Makefile package
make -f $(ROOT_SRCDIR)/Makefile clean
vendor: tools/glide glide.yaml
make -f $(ROOT_SRCDIR)/Makefile clean
vendor: tools/glide glide.yaml
@@
-185,7
+196,7
@@
tools/glide:
@test -f $(LOCAL_TOOLSDIR)/glide || { \
echo "Downloading glide"; \
mkdir -p $(LOCAL_TOOLSDIR); \
@test -f $(LOCAL_TOOLSDIR)/glide || { \
echo "Downloading glide"; \
mkdir -p $(LOCAL_TOOLSDIR); \
- curl --silent -L https://glide.sh/get | GOBIN=$(LOCAL_TOOLSDIR) sh; \
+ curl --silent -
-connect-timeout 60 --retry 3 -
L https://glide.sh/get | GOBIN=$(LOCAL_TOOLSDIR) sh; \
}
.PHONY: tools/syncthing
}
.PHONY: tools/syncthing
@@
-211,7
+222,7
@@
checkgover:
.PHONY: help
help:
@echo "Main supported rules:"
.PHONY: help
help:
@echo "Main supported rules:"
- @echo " all (default)"
+ @echo " all
(default)"
@echo " build"
@echo " package"
@echo " install"
@echo " build"
@echo " package"
@echo " install"