Updating the mmctl process to set the value once and than use it. Also added the basic auth code from agniva
Этот коммит содержится в:
2
Makefile
2
Makefile
@@ -115,7 +115,7 @@ ALL_PACKAGES=$(TE_PACKAGES)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Decide what version of prebuilt binaries to download. This will use the release-* branch names or change to the latest.
|
# Decide what version of prebuilt binaries to download. This will use the release-* branch names or change to the latest.
|
||||||
MMCTL_REL_TO_DOWNLOAD = $(shell scripts/get_latest_release.sh 'mattermost/mmctl' 'release-')
|
MMCTL_REL_TO_DOWNLOAD:=$(shell scripts/get_latest_release.sh 'mattermost/mmctl' 'release-')
|
||||||
|
|
||||||
all: run ## Alias for 'run'.
|
all: run ## Alias for 'run'.
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ BASIC_AUTH=""
|
|||||||
# If we find a github username and token, we use that.
|
# If we find a github username and token, we use that.
|
||||||
# In CI, these variables are available and useful to avoid rate limits which is
|
# In CI, these variables are available and useful to avoid rate limits which is
|
||||||
# much more strict for unauthenticated requests.
|
# much more strict for unauthenticated requests.
|
||||||
if [[ $GITHUB_USERNAME != "" && $GITHUB_TOKEN != "" ]];
|
if [[ ! -z "$GITHUB_USERNAME" && ! -z "$GITHUB_TOKEN" ]];
|
||||||
then
|
then
|
||||||
BASIC_AUTH="--user $GITHUB_USERNAME:$GITHUB_TOKEN"
|
BASIC_AUTH="--user $GITHUB_USERNAME:$GITHUB_TOKEN"
|
||||||
fi
|
fi
|
||||||
@@ -44,7 +44,7 @@ if [[ "$THIS_BRANCH" =~ $BRANCH_TO_USE || $DRAFT =~ "true" ]]; then
|
|||||||
REL_TO_USE=$(curl --silent $BASIC_AUTH "https://api.github.com/repos/$REPO_TO_USE/releases" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed -n "/$VERSION_REL/p" | sort -rV | head -n 1)
|
REL_TO_USE=$(curl --silent $BASIC_AUTH "https://api.github.com/repos/$REPO_TO_USE/releases" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed -n "/$VERSION_REL/p" | sort -rV | head -n 1)
|
||||||
elif [[ "$THIS_BRANCH" =~ "master" ]]; then
|
elif [[ "$THIS_BRANCH" =~ "master" ]]; then
|
||||||
# Get the latest release even if its a pre-release
|
# Get the latest release even if its a pre-release
|
||||||
REL_TO_USE=$(curl --silent $BASIC_AUTH" https://api.github.com/repos/$REPO_TO_USE/releases" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sort -rV | head -n 1)
|
REL_TO_USE=$(curl --silent $BASIC_AUTH "https://api.github.com/repos/$REPO_TO_USE/releases" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sort -rV | head -n 1)
|
||||||
else
|
else
|
||||||
REL_TO_USE=$LATEST_REL
|
REL_TO_USE=$LATEST_REL
|
||||||
fi
|
fi
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user