0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-25 05:31:37 +00:00
netdata_netdata/.github/scripts/check_latest_versions.py
Tasos Katsoulas 4141e137ec
Introduce agent release metadata pipelines ()
* For stable releases we updated when an new version published or deleted in netdata/netdata repo
* You can manually update to the latest (per channel) major versions.
* We update the newly published version during CI build process (if an release occurred) for nightly releases.

---------

Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud>
Co-authored-by: Austin S. Hemmelgarn <austin@netdata.cloud>
2023-11-16 17:13:39 +02:00

33 lines
1.3 KiB
Python
Executable file

import sys
import os
import modules.version_manipulation as ndvm
import modules.github_actions as cigh
def main(command_line_args):
"""
Inputs: Single version or multiple versions
Outputs:
Create files with the versions that needed update under temp_dir/staging-new-releases
Setting the GitHub outputs, 'versions_needs_update' to 'true'
"""
versions = [str(arg) for arg in command_line_args]
# Create a temp output folder for the release that need update
staging = os.path.join(os.environ.get('TMPDIR', '/tmp'), 'staging-new-releases')
os.makedirs(staging, exist_ok=True)
for version in versions:
temp_value = ndvm.compare_version_with_remote(version)
if temp_value:
path, filename = ndvm.get_release_path_and_filename(version)
release_path = os.path.join(staging, path)
os.makedirs(release_path, exist_ok=True)
file_release_path = os.path.join(release_path, filename)
with open(file_release_path, "w") as file:
print("Creating local copy of the release version update at: ", file_release_path)
file.write(version)
if cigh.run_as_github_action():
cigh.update_github_output("versions_needs_update", "true")
if __name__ == "__main__":
main(sys.argv[1:])