Skip to content

Commit

Permalink
fix(containerfile): wrong binary locations
Browse files Browse the repository at this point in the history
  • Loading branch information
RouHim committed Dec 17, 2022
1 parent 657bd07 commit 690d7ae
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: linux/amd64, linux/arm64, linux/arm

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- uses: Swatinem/rust-cache@v2 # use rust / cargo caching
with:
Expand Down
3 changes: 1 addition & 2 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ COPY target /target
COPY stage-arch-bin.sh /target

# This will copy the cpu arch corresponding binary to /target/this-week-in-past
RUN ./stage-arch-bin.sh this-week-in-past

RUN bash stage-arch-bin.sh this-week-in-past

# # # # # # # # # # # # # # # # # # # #
# Run image
Expand Down
15 changes: 7 additions & 8 deletions stage-arch-bin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,22 @@ else
exit 1
fi

# TODO: fix for armv7 -> armv7l
CURRENT_ARCH=$(uname -m)

if [ "$CURRENT_ARCH" = "armv7l" ]; then
CURRENT_ARCH="armv7"
fi

echo "Current arch is: $CURRENT_ARCH"

find . -wholename "*release/${1}" -type f | while read arch_binary; do
echo "Checking: $arch_binary"
if [[ "$arch_binary" = *"$CURRENT_ARCH"* ]]; then
echo "Binary for this cpu arch is: $arch_binary"
echo " -> Binary for this cpu arch is: $arch_binary"
file "$arch_binary"
cp "$arch_binary" "${1}"
exit 0
else
echo " -> No match"
fi
done

echo "No binary found for: $CURRENT_ARCH"
echo "List of available binaries:"
find . -wholename "*release/${1}" -type f
exit 1
done

0 comments on commit 690d7ae

Please sign in to comment.