mirror of
https://github.com/alibaba/arthas.git
synced 2026-11-14 06:45:19 +00:00
as.sh support download from maven central repository. #3
This commit is contained in:
1 parent
ef2917541a
commit
3358f31841
1 file changed
+6
-5
@@ -21,8 +21,8 @@ ARTHAS_VERSION=
|
|||||||
ARTHAS_SCRIPT_VERSION=3.0.2
|
ARTHAS_SCRIPT_VERSION=3.0.2
|
||||||
|
|
||||||
# arthas remote url
|
# arthas remote url
|
||||||
ARTHAS_REMOTE_VERSION_URL="https://alibaba.github.io/arthas/latest_version"
|
ARTHAS_REMOTE_VERSION_URL="http://search.maven.org/solrsearch/select?q=g:%22com.taobao.arthas%22+AND+a:%22arthas-packaging%22"
|
||||||
ARTHAS_REMOTE_DOWNLOAD_URL="http://arthas.io/mdtool"
|
ARTHAS_REMOTE_DOWNLOAD_URL="http://search.maven.org/classic/remotecontent?filepath=com/taobao/arthas/arthas-packaging"
|
||||||
|
|
||||||
# update timeout(sec)
|
# update timeout(sec)
|
||||||
SO_TIMEOUT=5
|
SO_TIMEOUT=5
|
||||||
@@ -135,7 +135,7 @@ get_local_version()
|
|||||||
# get latest version from remote
|
# get latest version from remote
|
||||||
get_remote_version()
|
get_remote_version()
|
||||||
{
|
{
|
||||||
curl -sLk --connect-timeout ${SO_TIMEOUT} "${ARTHAS_REMOTE_VERSION_URL}"
|
curl -sLk --connect-timeout ${SO_TIMEOUT} "${ARTHAS_REMOTE_VERSION_URL}" | sed 's/{.*latestVersion":"*\([0-9a-zA-Z\\.\\-]*\)"*,*.*}/\1/'
|
||||||
}
|
}
|
||||||
|
|
||||||
# make version format to comparable format like 000.000.(0){15}
|
# make version format to comparable format like 000.000.(0){15}
|
||||||
@@ -155,7 +155,8 @@ update_if_necessary()
|
|||||||
|
|
||||||
local temp_target_lib_dir="$TMP_DIR/temp_${update_version}_$$"
|
local temp_target_lib_dir="$TMP_DIR/temp_${update_version}_$$"
|
||||||
local temp_target_lib_zip="${temp_target_lib_dir}/arthas-${update_version}-bin.zip"
|
local temp_target_lib_zip="${temp_target_lib_dir}/arthas-${update_version}-bin.zip"
|
||||||
local target_lib_dir="${ARTHAS_LIB_DIR}/${update_version}"
|
local target_lib_dir="${ARTHAS_LIB_DIR}/${update_version}/arthas"
|
||||||
|
mkdir -p ${target_lib_dir}
|
||||||
|
|
||||||
# clean
|
# clean
|
||||||
rm -rf ${temp_target_lib_dir}
|
rm -rf ${temp_target_lib_dir}
|
||||||
@@ -169,7 +170,7 @@ update_if_necessary()
|
|||||||
-#Lk \
|
-#Lk \
|
||||||
--connect-timeout ${SO_TIMEOUT} \
|
--connect-timeout ${SO_TIMEOUT} \
|
||||||
-o ${temp_target_lib_zip} \
|
-o ${temp_target_lib_zip} \
|
||||||
"${ARTHAS_REMOTE_DOWNLOAD_URL}/${update_version}/arthas-${update_version}-bin.zip" \
|
"${ARTHAS_REMOTE_DOWNLOAD_URL}/${update_version}/arthas-packaging-${update_version}-bin.zip" \
|
||||||
|| return 1
|
|| return 1
|
||||||
|
|
||||||
# unzip arthas lib
|
# unzip arthas lib
|
||||||
|
|||||||
Reference in new issue
Block a user