-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathtest-gems-docker.sh
More file actions
executable file
·38 lines (31 loc) · 1.2 KB
/
test-gems-docker.sh
File metadata and controls
executable file
·38 lines (31 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
set -e
SELFDIR=`dirname "$0"`
SELFDIR=`cd "$SELFDIR" && pwd`
if [ -z "$1" ]; then
echo "Usage: $0 output/<ruby-version>-<arch> <image>"
echo "example: $0 3.2.9-arm64"
echo "image: alpine:latest"
echo "image is optional|default: alpine:latest"
exit 1
fi
IMAGE=${2:-"alpine:latest"}
if ! command -v docker &> /dev/null
then
echo "Error: docker could not be found"
exit 1
fi
ARCH=$(echo $1 | sed -E 's/output\///' | sed 's/.*-//')
RUBY_VERSION=$(echo $1 | sed -E 's/(-arm64|-x86_64)//' | sed -E 's/output\///')
echo "ARCH: $ARCH"
echo "RUBY_VERSION: $RUBY_VERSION"
# ## override for docker platform
[ "$ARCH" == "x86_64" ] && ARCH="amd64"
echo docker run --platform linux/"${ARCH}" --rm --entrypoint /bin/sh -v $SELFDIR/..:/home "${IMAGE}" -c "apk add bash gcc tzdata && ./home/shared/test-gems.sh home/linux-musl/"$@"";
docker run --platform linux/"${ARCH}" --rm --entrypoint /bin/sh -v $SELFDIR/..:/home "${IMAGE}" -c "apk add bash gcc tzdata && ./home/shared/test-gems.sh home/linux-musl/"$@"";
# tzinfo required for et-orbi / fugit
# gcc required for
# - charlock_holmes
# - mysql2
# - unf_ext
# Error loading shared library libgcc_s.so.1: No such file or directory