[MM-28303]: check if mmctl exists before checking on Github and reduce requests to Github (#15387)

Summary:
Every make call would ping Github to find out the mmctl version to download. Each check made 4 requests to Github. So every make execution resulted in 4 requests to Github. This leads to frequent rate-limit errors from Github.
In this PR we check for the mmctl version only if mmctl doesn't already exist. We also print a more helpful error message.
Reduce the number the number of requests to Github from 4 to 2.

Ticket Link:
https://mattermost.atlassian.net/browse/MM-28303
Этот коммит содержится в:
Ashish Bhate
2020-09-24 14:54:57 +05:30
коммит произвёл GitHub
родитель 605f96fbea
Коммит ee76ad435b
4 изменённых файлов: 68 добавлений и 39 удалений

Просмотреть файл

@@ -97,6 +97,9 @@ package:
mkdir -p $(DIST_PATH)/client
cp -RL $(BUILD_WEBAPP_DIR)/dist/* $(DIST_PATH)/client
$(eval MMCTL_REL_TO_DOWNLOAD := $(shell scripts/get_latest_release.sh 'mattermost/mmctl' 'release-'))
@echo "Using mmctl version $(MMCTL_REL_TO_DOWNLOAD)"
@# Help files
ifeq ($(BUILD_ENTERPRISE_READY),true)
cp $(BUILD_ENTERPRISE_DIR)/ENTERPRISE-EDITION-LICENSE.txt $(DIST_PATH)