-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setup_osie: Add --retry to curl, exit if it fails #533
Conversation
Signed-off-by: Thomas Stromberg <[email protected]>
Signed-off-by: Thomas Stromberg <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #533 +/- ##
=======================================
Coverage 33.59% 33.59%
=======================================
Files 44 44
Lines 3387 3387
=======================================
Hits 1138 1138
Misses 2152 2152
Partials 97 97 Continue to review full report at Codecov.
|
echo "$INFO extracting osie tar" | ||
tar -zxf "$TB_OSIE_TAR" | ||
|
||
if [ -d "$osie_current" ] && [ -d "$tink_workflow" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should probably check for
if [ -d "$osie_current" ] && [ -d "$tink_workflow" ]; then | |
if [ -f "$osie_current/vmlinuz-x86_64" ] && [ -f "$tink_workflow/workflow-helper.sh" ]; then |
instead. Otherwise if curl fails then a re-run will skip curl right? Because you've mkdir -p
these dirs right after this branch
tar -zxf "$TB_OSIE_TAR" | ||
|
||
if pushd osie*/; then | ||
if mv workflow-helper.sh workflow-helper-rc "$tink_workflow"; then | ||
cp -r ./* "$osie_current" | ||
else | ||
echo "$ERR failed to move 'workflow-helper.sh' and 'workflow-helper-rc'" | ||
exit 1 | ||
fi | ||
else | ||
echo "$INFO found existing osie files, skipping osie setup" | ||
popd | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this should actually be:
tar -zxf "$TB_OSIE_TAR" | |
if pushd osie*/; then | |
if mv workflow-helper.sh workflow-helper-rc "$tink_workflow"; then | |
cp -r ./* "$osie_current" | |
else | |
echo "$ERR failed to move 'workflow-helper.sh' and 'workflow-helper-rc'" | |
exit 1 | |
fi | |
else | |
echo "$INFO found existing osie files, skipping osie setup" | |
popd | |
fi | |
if ! tar -zxf "$TB_OSIE_TAR" -C "$osie_current"; then | |
echo "$ERR failed to extract osie tarball"; | |
exit 1; | |
fi | |
if ! mv/cp "$osie_current/workflow-helper.sh" "$osie_current/workflow-helper-rc" "$tink_workflow"; then | |
echo "$ERR failed to move 'workflow-helper.sh' and 'workflow-helper-rc'"; | |
exit 1; | |
fi |
no need to change dir, ..., mv .* when tar
can do what we want right? This way we don't have to deal with pushd errors (currently ignore, which tbf shouldn't ever really happen) but also doesn't keep 3 copies of osie around (the tarball, one in $cwd, and the one in $osie_current)... just 2 copies.
Hey @tstromberg @mmlb. If I'm not mistaken, I don't think |
Fixes #306
Includes some minor refactoring to decrease the indentation level and adds some informational messages.
(PS: On that note, I really miss having a progress bar for curl, given that the download takes ~10 minutes here)