Add release info

This commit is contained in:
Gregor 2019-07-04 20:26:15 +02:00
parent 21c35a1a97
commit 4b279939b6
2 changed files with 8 additions and 1 deletions

View File

@ -130,11 +130,14 @@ static int node_info( lua_State* L )
lua_pushinteger(L, flash_rom_get_speed()); lua_pushinteger(L, flash_rom_get_speed());
lua_pushstring(L, BUILDINFO_BRANCH); lua_pushstring(L, BUILDINFO_BRANCH);
lua_pushstring(L, BUILDINFO_COMMIT_ID); lua_pushstring(L, BUILDINFO_COMMIT_ID);
lua_pushstring(L, BUILDINFO_RELEASE);
lua_pushnumber(L, BUILDINFO_RELEASE_DTS);
lua_pushboolean(L, BUILDINFO_SSL); lua_pushboolean(L, BUILDINFO_SSL);
lua_pushstring(L, BUILDINFO_LFS); lua_pushstring(L, BUILDINFO_LFS);
lua_pushstring(L, BUILDINFO_MODULES); lua_pushstring(L, BUILDINFO_MODULES);
lua_pushstring(L, BUILDINFO_BUILD_TYPE); lua_pushstring(L, BUILDINFO_BUILD_TYPE);
return 14;
return 16;
} }
// Lua: chipid() // Lua: chipid()

View File

@ -4,6 +4,7 @@ BUILD_DATE="$(date "+%Y-%m-%d %H:%M")"
COMMIT_ID="$(git rev-parse HEAD)" COMMIT_ID="$(git rev-parse HEAD)"
BRANCH="$(git rev-parse --abbrev-ref HEAD | sed -r 's/[\/\\]+/_/g')" BRANCH="$(git rev-parse --abbrev-ref HEAD | sed -r 's/[\/\\]+/_/g')"
RELEASE="$(git describe --tags --long | sed -r 's/(.*)-(.*)-.*/\1 +\2/g' | sed 's/ +0$//')" RELEASE="$(git describe --tags --long | sed -r 's/(.*)-(.*)-.*/\1 +\2/g' | sed 's/ +0$//')"
RELEASE_DTS=0$(git show -s --format=%cd --date=format:"%Y%m%d%H%M" HEAD)
# figure out whether SSL is enabled in user_config.h # figure out whether SSL is enabled in user_config.h
if grep -Eq "^#define CLIENT_SSL_ENABLE" ../app/include/user_config.h; then if grep -Eq "^#define CLIENT_SSL_ENABLE" ../app/include/user_config.h; then
@ -39,6 +40,7 @@ EndOfMessage
echo "#define BUILDINFO_BRANCH \""$BRANCH"\"" >> $TEMPFILE echo "#define BUILDINFO_BRANCH \""$BRANCH"\"" >> $TEMPFILE
echo "#define BUILDINFO_COMMIT_ID \""$COMMIT_ID"\"" >> $TEMPFILE echo "#define BUILDINFO_COMMIT_ID \""$COMMIT_ID"\"" >> $TEMPFILE
echo "#define BUILDINFO_RELEASE \""$RELEASE"\"" >> $TEMPFILE echo "#define BUILDINFO_RELEASE \""$RELEASE"\"" >> $TEMPFILE
echo "#define BUILDINFO_RELEASE_DTS "$RELEASE_DTS"" >> $TEMPFILE
echo "#define BUILDINFO_SSL "$SSL >> $TEMPFILE echo "#define BUILDINFO_SSL "$SSL >> $TEMPFILE
echo "#define BUILDINFO_SSL_STR \""$SSL"\"" >> $TEMPFILE echo "#define BUILDINFO_SSL_STR \""$SSL"\"" >> $TEMPFILE
echo "#define BUILDINFO_BUILD_TYPE \""$BUILD_TYPE"\"" >> $TEMPFILE echo "#define BUILDINFO_BUILD_TYPE \""$BUILD_TYPE"\"" >> $TEMPFILE
@ -50,6 +52,8 @@ cat >> $TEMPFILE << EndOfMessage2
#define NODE_VERSION_LONG \\ #define NODE_VERSION_LONG \\
"\tbranch: '" BUILDINFO_BRANCH "'\n" \\ "\tbranch: '" BUILDINFO_BRANCH "'\n" \\
"\tcommit: '" BUILDINFO_COMMIT_ID "'\n" \\ "\tcommit: '" BUILDINFO_COMMIT_ID "'\n" \\
"\trelease: '" BUILDINFO_RELEASE "'\n" \\
"\trelease DTS: '" BUILDINFO_RELEASE_DTS "'\n" \\
"\tSSL: '" BUILDINFO_SSL_STR "'\n" \\ "\tSSL: '" BUILDINFO_SSL_STR "'\n" \\
"\tBuild type: '" BUILDINFO_BUILD_TYPE "'\n" \\ "\tBuild type: '" BUILDINFO_BUILD_TYPE "'\n" \\
"\tLFS: '" BUILDINFO_LFS "'\n" \\ "\tLFS: '" BUILDINFO_LFS "'\n" \\