diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 94ac82b7f38ae90c2346762a92422a039bc3713a..c0ff9f69153591eaeb70270e51bbd42a15c9e308 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,10 +10,6 @@ make_32bit_zip: tags: # - CPAV_old - python - only: - - tags - - release* - - make_zip # see deepwind repo for configuring report/zip compilation diff --git a/utils/prepare_zip_file.py b/utils/prepare_zip_file.py index 63e062366782e4dfc4bcb8ae441f925677e78b03..8313946059c67759c2c7e8ccee48526b4215c24d 100644 --- a/utils/prepare_zip_file.py +++ b/utils/prepare_zip_file.py @@ -3,10 +3,9 @@ """ import os import shutil -import subprocess import sys -from refutils import (base_to_hs2, base_to_step, base_to_turb, delete_dlls, - clone_repo, get_repo_info) +from refutils.htc_conversion import base_to_hs2, base_to_step, base_to_turb +from refutils.dll_utils import get_towerclearance_mblade, clone_dll_repo, delete_dlls if __name__ == '__main__': @@ -22,8 +21,7 @@ if __name__ == '__main__': dll_list = [('dtu_we_controller.dll', 'dtu_we_controller.dll'), ('generator_servo.dll', 'generator_servo.dll'), ('mech_brake.dll', 'mech_brake.dll'), - ('servo_with_limits.dll', 'servo_with_limits.dll'), - ('towerclearance_mblade.dll', 'towerclearance_mblade.dll')] + ('servo_with_limits.dll', 'servo_with_limits.dll')] # ======= make hawcstab2 and step-wind files ======= htc_base = mod_dir + f'htc/{basename}.htc' @@ -45,7 +43,7 @@ if __name__ == '__main__': step_path = mod_dir + f'htc/{basename}_step.htc' base_to_step(htc_base, step_path, **kwargs) - # ======= clone dll repo and copy in the ones we need ======= + # ======= create/clean control folder ======= control_dir = mod_dir + 'control/' # must end with slash! # delete dlls in control repo @@ -54,27 +52,18 @@ if __name__ == '__main__': except FileNotFoundError: # if control folder doesn't exist, create it os.mkdir(control_dir) + # ======= download tower clearance ======= + get_towerclearance_mblade(folder=control_dir) + + # ======= get dlls from binary repo ======= + # clone dll repo (will throw error if repo not deleted) - clone_repo(dll_git_url, dll_branch) + clone_dll_repo(dll_branch) # copy dlls to control repo [shutil.copy('control-win32/' + t[0], control_dir + t[1]) for t in dll_list] - # delete control binaries - #shutil.rmtree('./control-win32/') # doesn't work on WINDOWS >:( - #subprocess.run(['rmdir', '/s', '/q', 'control-win32'], shell=True, check=True) - - # write the git branch and commit to file - #url, branch, commit, date = get_repo_info() - #with open(mod_dir + 'git_version.txt', 'w') as f: - # f.write(f'Git info for {basename} zip file\n') - # f.write('------------------------------------\n') - # f.write('Automatically generated using CI on following repo.\n\n') - # f.write(f'Repo url: {url}\n') - # f.write(f'Branch: {branch}\n') - # f.write(f'Commit: {commit} made on {date}\n') - # ======= make the archive ======= shutil.make_archive(zip_name, 'zip', mod_dir)