Update to get latest release from S3 (#15952)
* Update to get latest release from S3 * Update mmctl to download to use S3 * Download MMCTL from S3 * Update download_mmctl_release.sh * Update Makefile * Update release.mk * Update the script called, remove call to sub shell and clean up indentation * Add quotes around THIS_BRANCH var * Update script to support overriding the OS for packaging Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
9b1dee7087
Коммит
e280aa1c63
9
Makefile
9
Makefile
@@ -188,14 +188,9 @@ prepackaged-plugins: ## Populate the prepackaged-plugins directory
|
|||||||
|
|
||||||
prepackaged-binaries: ## Populate the prepackaged-binaries to the bin directory
|
prepackaged-binaries: ## Populate the prepackaged-binaries to the bin directory
|
||||||
ifeq ($(shell test -f bin/mmctl && printf "yes"),yes)
|
ifeq ($(shell test -f bin/mmctl && printf "yes"),yes)
|
||||||
@echo "mmctl already exists in bin/mmctl not downloading a new version."
|
@echo "MMCTL already exists in bin/mmctl not downloading a new version."
|
||||||
else
|
else
|
||||||
@MMCTL_VERSION=$$(scripts/get_latest_release.sh mattermost/mmctl release-); if [ $$? -eq 0 ]; then \
|
@scripts/download_mmctl_release.sh
|
||||||
scripts/download_mmctl_release.sh $$MMCTL_VERSION; \
|
|
||||||
else \
|
|
||||||
echo $$MMCTL_VERSION; \
|
|
||||||
exit 1; \
|
|
||||||
fi;
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
golangci-lint: ## Run golangci-lint on codebase
|
golangci-lint: ## Run golangci-lint on codebase
|
||||||
|
|||||||
@@ -97,8 +97,8 @@ package:
|
|||||||
mkdir -p $(DIST_PATH)/client
|
mkdir -p $(DIST_PATH)/client
|
||||||
cp -RL $(BUILD_WEBAPP_DIR)/dist/* $(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-'))
|
@#Download MMCTL
|
||||||
@echo "Using mmctl version $(MMCTL_REL_TO_DOWNLOAD)"
|
scripts/download_mmctl_release.sh
|
||||||
|
|
||||||
@# Help files
|
@# Help files
|
||||||
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
||||||
@@ -133,7 +133,8 @@ else
|
|||||||
cp $(GOBIN)/darwin_amd64/mattermost $(DIST_PATH)/bin # from cross-compiled bin dir
|
cp $(GOBIN)/darwin_amd64/mattermost $(DIST_PATH)/bin # from cross-compiled bin dir
|
||||||
cp $(GOBIN)/darwin_amd64/platform $(DIST_PATH)/bin # from cross-compiled bin dir
|
cp $(GOBIN)/darwin_amd64/platform $(DIST_PATH)/bin # from cross-compiled bin dir
|
||||||
endif
|
endif
|
||||||
MMCTL_FILE="darwin_amd64.tar" && curl -f -O -L https://github.com/mattermost/mmctl/releases/download/$(MMCTL_REL_TO_DOWNLOAD)/$$MMCTL_FILE && tar -xvf $$MMCTL_FILE -C $(DIST_PATH)/bin && rm $$MMCTL_FILE
|
#Download MMCTL for OSX
|
||||||
|
scripts/download_mmctl_release.sh "Darwin"
|
||||||
@# Prepackage plugins
|
@# Prepackage plugins
|
||||||
@for plugin_package in $(PLUGIN_PACKAGES) ; do \
|
@for plugin_package in $(PLUGIN_PACKAGES) ; do \
|
||||||
ARCH="osx-amd64"; \
|
ARCH="osx-amd64"; \
|
||||||
@@ -167,7 +168,8 @@ else
|
|||||||
cp $(GOBIN)/windows_amd64/mattermost.exe $(DIST_PATH)/bin # from cross-compiled bin dir
|
cp $(GOBIN)/windows_amd64/mattermost.exe $(DIST_PATH)/bin # from cross-compiled bin dir
|
||||||
cp $(GOBIN)/windows_amd64/platform.exe $(DIST_PATH)/bin # from cross-compiled bin dir
|
cp $(GOBIN)/windows_amd64/platform.exe $(DIST_PATH)/bin # from cross-compiled bin dir
|
||||||
endif
|
endif
|
||||||
MMCTL_FILE="windows_amd64.zip" && curl -f -O -L https://github.com/mattermost/mmctl/releases/download/$(MMCTL_REL_TO_DOWNLOAD)/$$MMCTL_FILE && unzip -o $$MMCTL_FILE -d $(DIST_PATH)/bin && rm $$MMCTL_FILE
|
#Download MMCTL for Windows
|
||||||
|
scripts/download_mmctl_release.sh "Windows"
|
||||||
@# Prepackage plugins
|
@# Prepackage plugins
|
||||||
@for plugin_package in $(PLUGIN_PACKAGES) ; do \
|
@for plugin_package in $(PLUGIN_PACKAGES) ; do \
|
||||||
ARCH="windows-amd64"; \
|
ARCH="windows-amd64"; \
|
||||||
@@ -201,7 +203,8 @@ else
|
|||||||
cp $(GOBIN)/linux_amd64/mattermost $(DIST_PATH)/bin # from cross-compiled bin dir
|
cp $(GOBIN)/linux_amd64/mattermost $(DIST_PATH)/bin # from cross-compiled bin dir
|
||||||
cp $(GOBIN)/linux_amd64/platform $(DIST_PATH)/bin # from cross-compiled bin dir
|
cp $(GOBIN)/linux_amd64/platform $(DIST_PATH)/bin # from cross-compiled bin dir
|
||||||
endif
|
endif
|
||||||
MMCTL_FILE="linux_amd64.tar" && curl -f -O -L https://github.com/mattermost/mmctl/releases/download/$(MMCTL_REL_TO_DOWNLOAD)/$$MMCTL_FILE && tar -xvf $$MMCTL_FILE -C $(DIST_PATH)/bin && rm $$MMCTL_FILE
|
#Download MMCTL for Linux
|
||||||
|
scripts/download_mmctl_release.sh "Linux"
|
||||||
@# Prepackage plugins
|
@# Prepackage plugins
|
||||||
@for plugin_package in $(PLUGIN_PACKAGES) ; do \
|
@for plugin_package in $(PLUGIN_PACKAGES) ; do \
|
||||||
ARCH="linux-amd64"; \
|
ARCH="linux-amd64"; \
|
||||||
|
|||||||
@@ -8,22 +8,41 @@ else
|
|||||||
PLATFORM=$(uname)
|
PLATFORM=$(uname)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ ! -z "$1" ]];
|
||||||
|
then
|
||||||
|
OVERRIDE_OS=$1
|
||||||
|
fi
|
||||||
|
|
||||||
# strip whitespace
|
# strip whitespace
|
||||||
RELEASE_TO_DOWNLOAD=$(echo "$1" | xargs echo)
|
THIS_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||||
echo "Downloading prepackaged binary: https://github.com/mattermost/mmctl/releases/$RELEASE_TO_DOWNLOAD";
|
if [[ "$THIS_BRANCH" =~ 'release-' ]];
|
||||||
|
then
|
||||||
|
RELEASE_TO_DOWNLOAD="$THIS_BRANCH"
|
||||||
|
else
|
||||||
|
RELEASE_TO_DOWNLOAD=master
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Downloading prepackaged binary: https://releases.mattermost.com/mmctl/$RELEASE_TO_DOWNLOAD";
|
||||||
|
|
||||||
|
# When packaging we need to download different platforms
|
||||||
|
# Values need to match the case statement below
|
||||||
|
if [[ ! -z "$OVERRIDE_OS" ]];
|
||||||
|
then
|
||||||
|
PLATFORM="$OVERRIDE_OS"
|
||||||
|
fi
|
||||||
|
|
||||||
case "$PLATFORM" in
|
case "$PLATFORM" in
|
||||||
|
|
||||||
Linux)
|
Linux)
|
||||||
MMCTL_FILE="linux_amd64.tar" && curl -f -O -L https://github.com/mattermost/mmctl/releases/download/"$RELEASE_TO_DOWNLOAD"/"$MMCTL_FILE" && tar -xvf "$MMCTL_FILE" -C bin && rm "$MMCTL_FILE";
|
MMCTL_FILE="linux_amd64.tar" && curl -f -O -L https://releases.mattermost.com/mmctl/"$RELEASE_TO_DOWNLOAD"/"$MMCTL_FILE" && tar -xvf "$MMCTL_FILE" -C bin && rm "$MMCTL_FILE";
|
||||||
;;
|
;;
|
||||||
|
|
||||||
Darwin)
|
Darwin)
|
||||||
MMCTL_FILE="darwin_amd64.tar" && curl -f -O -L https://github.com/mattermost/mmctl/releases/download/"$RELEASE_TO_DOWNLOAD"/"$MMCTL_FILE" && tar -xvf "$MMCTL_FILE" -C bin && rm "$MMCTL_FILE";
|
MMCTL_FILE="darwin_amd64.tar" && curl -f -O -L https://releases.mattermost.com/mmctl/"$RELEASE_TO_DOWNLOAD"/"$MMCTL_FILE" && tar -xvf "$MMCTL_FILE" -C bin && rm "$MMCTL_FILE";
|
||||||
;;
|
;;
|
||||||
|
|
||||||
Windows)
|
Windows)
|
||||||
MMCTL_FILE="windows_amd64.zip" && curl -f -O -L https://github.com/mattermost/mmctl/releases/download/"$RELEASE_TO_DOWNLOAD"/"$MMCTL_FILE" && unzip -o "$MMCTL_FILE" -d bin && rm "$MMCTL_FILE";
|
MMCTL_FILE="windows_amd64.zip" && curl -f -O -L https://releases.mattermost.com/mmctl/"$RELEASE_TO_DOWNLOAD"/"$MMCTL_FILE" && unzip -o "$MMCTL_FILE" -d bin && rm "$MMCTL_FILE";
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user