Skip to content
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

fixed errors when running appliance packager on macOS #492

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions scripts/malcolm_appliance_packager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ CURRENT_REV_SHA="$(git rev-parse --short --verify HEAD)"
if [ -z "$CURRENT_REV_SHA" ]; then
CURRENT_REV_TAG="$(date +%Y.%m.%d_%H:%M:%S)"
else
CURRENT_REV_DATE="$(git log -1 --format="%at" | xargs -I{} date -d @{} +%Y%m%d_%H%M%S)"
if [[ "$(uname -s)" == 'Darwin' ]]; then
CURRENT_REV_DATE="$(git log -1 --format="%at" | xargs -I{} date -r {} +%Y%m%d_%H%M%S)"
else
CURRENT_REV_DATE="$(git log -1 --format="%at" | xargs -I{} date -d @{} +%Y%m%d_%H%M%S)"
fi
if [ -z "$CURRENT_REV_DATE" ]; then
CURRENT_REV_TAG="$(date +%Y.%m.%d_%H:%M:%S)"
fi
Expand Down Expand Up @@ -143,7 +147,11 @@ if mkdir "$DESTDIR"; then
cp $VERBOSE "$SCRIPT_PATH/malcolm_kubernetes.py" "$RUN_PATH/"
cp $VERBOSE "$SCRIPT_PATH/malcolm_utils.py" "$RUN_PATH/"

tar $VERBOSE --numeric-owner --owner=0 --group=0 -czf "$DESTNAME" "./$(basename $DESTDIR)/"
if [[ "$(uname -s)" == "Darwin" ]]; then
tar $VERBOSE -czf "$DESTNAME" "./$(basename $DESTDIR)/"
else
tar $VERBOSE --numeric-owner --owner=0 --group=0 -czf "$DESTNAME" "./$(basename $DESTDIR)/"
fi
echo "Packaged Malcolm to \"$DESTNAME\""

unset CONFIRMATION
Expand Down