Change develop to latest and other branch will get the tag to decide which

version it is staying on
revert-12383-port_py3_syntax
minqiyang 7 years ago
parent fe49e46904
commit 1d8cbc1738

@ -11,6 +11,20 @@ while ("${PADDLE_VERSION}" STREQUAL "")
RESULT_VARIABLE GIT_RESULT
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if (NOT ${GIT_RESULT})
# Get current branch name
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref ${tmp_version}
WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_BRANCH_NAME
RESULT_VARIABLE GIT_BRANCH_RESULT
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
# If current branch is develop, then version will be latest
if (NOT ${GIT_BRANCH_RESULT})
if (${GIT_BRANCH_NAME} MATCHES "develop")
set(PADDLE_VERSION "latest")
continue()
endif()
endif()
# Check the tag is a correct version
if (${GIT_TAG_NAME} MATCHES "${COMMIT_VERSION_REGEX}")
# if no tag was found, set PADDLE_VERSION to latest

Loading…
Cancel
Save