gitlab build number added
This commit is contained in:
parent
c7af671814
commit
0ca5946681
@ -21,7 +21,7 @@ static void *cmd_echo_on_cb(const char *cmd);
|
|||||||
static void *cmd_echo_off_cb(const char *cmd);
|
static void *cmd_echo_off_cb(const char *cmd);
|
||||||
|
|
||||||
struct command cmd_kosmos_version = {
|
struct command cmd_kosmos_version = {
|
||||||
.command = "uname",
|
.command = "kname",
|
||||||
.description = "Print current kosmos version.",
|
.description = "Print current kosmos version.",
|
||||||
.command_callback = cmd_kosmos_version_cb
|
.command_callback = cmd_kosmos_version_cb
|
||||||
};
|
};
|
||||||
@ -55,6 +55,8 @@ static void *cmd_kosmos_version_cb(const char *cmd)
|
|||||||
write(shell_object.shell_device, MAJOR_VERSION, strlen(MAJOR_VERSION));
|
write(shell_object.shell_device, MAJOR_VERSION, strlen(MAJOR_VERSION));
|
||||||
write(shell_object.shell_device, ".", 1);
|
write(shell_object.shell_device, ".", 1);
|
||||||
write(shell_object.shell_device, MINOR_VERSION, strlen(MINOR_VERSION));
|
write(shell_object.shell_device, MINOR_VERSION, strlen(MINOR_VERSION));
|
||||||
|
write(shell_object.shell_device, ".", 1);
|
||||||
|
write(shell_object.shell_device, BUILD_NUMBER, strlen(BUILD_NUMBER));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,5 +6,5 @@
|
|||||||
#define KERNEL_VERSION "unknown"
|
#define KERNEL_VERSION "unknown"
|
||||||
#define MAJOR_VERSION "unknown"
|
#define MAJOR_VERSION "unknown"
|
||||||
#define MINOR_VERSION "unknown"
|
#define MINOR_VERSION "unknown"
|
||||||
|
#define BUILD_NUMBER "unknown"
|
||||||
#endif /* VERSION_H */
|
#endif /* VERSION_H */
|
||||||
|
@ -12,6 +12,8 @@ def get_current_numbers():
|
|||||||
config["sw_major"] = os.environ["SW_MAJOR"]
|
config["sw_major"] = os.environ["SW_MAJOR"]
|
||||||
if os.environ.has_key("SW_MINOR"):
|
if os.environ.has_key("SW_MINOR"):
|
||||||
config["sw_minor"] = os.environ["SW_MINOR"]
|
config["sw_minor"] = os.environ["SW_MINOR"]
|
||||||
|
if os.environ.has_key("CI_BUILD_ID"):
|
||||||
|
config["build_id"] = os.environ["CI_BUILD_ID"]
|
||||||
return config
|
return config
|
||||||
|
|
||||||
def generate_include(numbers):
|
def generate_include(numbers):
|
||||||
@ -31,6 +33,10 @@ def generate_include(numbers):
|
|||||||
f.write("#define MINOR_VERSION\t\"" + numbers["sw_minor"] + "\"\n")
|
f.write("#define MINOR_VERSION\t\"" + numbers["sw_minor"] + "\"\n")
|
||||||
else:
|
else:
|
||||||
f.write("#define MINOR_VERSION\t\"unknown\"\n")
|
f.write("#define MINOR_VERSION\t\"unknown\"\n")
|
||||||
|
if numbers.has_key("build_id"):
|
||||||
|
f.write("#define BUILD_NUMBER\t\"" + numbers["build_id"] + "\"\n")
|
||||||
|
else:
|
||||||
|
f.write("#define BUILD_NUMBER\t\"unknown\"\n")
|
||||||
f.write("\n#endif /* VERSION_H */\n")
|
f.write("\n#endif /* VERSION_H */\n")
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user