Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dtu-10mw-rwt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HAWC Reference Models
dtu-10mw-rwt
Commits
4172d5c1
Commit
4172d5c1
authored
4 years ago
by
Jenni Rinker
Browse files
Options
Downloads
Patches
Plain Diff
restructured from refutils
parent
d697073b
No related branches found
Branches containing commit
No related tags found
1 merge request
!7
Resolve "Take towerclearance dll from direct download from repo"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
utils/prepare_zip_file.py
+10
-21
10 additions, 21 deletions
utils/prepare_zip_file.py
with
10 additions
and
21 deletions
utils/prepare_zip_file.py
+
10
−
21
View file @
4172d5c1
...
...
@@ -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
import
base_to_hs2
,
base_to_step
,
base_to_turb
from
refutils.dll_utils
import
get_towerclearance_mblade
,
clone_dll_repo
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
)
# ======= c
lone dll repo
an
d
co
py in the ones we need
=======
# ======= c
reate/cle
an co
ntrol 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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment