Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 6 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ DOCKER_BUILD_XTRA_ARGS=${DOCKER_BUILD_XTRA_ARGS-}
# Override the docker image name used.
DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME-}

# When building a docker container, these are the files that will sent and available.
DOCKER_EXTRA_CONTEXT="lang/ruby/Gemfile lang/ruby/avro.gemspec lang/ruby/Manifest share/VERSION.txt"

usage() {
echo "Usage: $0 {lint|test|dist|sign|clean|veryclean|docker [--args \"docker-args\"]|rat|githooks|docker-test}"
exit 1
Expand Down Expand Up @@ -300,8 +303,9 @@ do
echo "RUN getent group $GROUP_ID || groupadd -g $GROUP_ID $USER_NAME"
echo "RUN getent passwd $USER_ID || useradd -g $GROUP_ID -u $USER_ID -k /root -m $USER_NAME"
} > Dockerfile
# Include the ruby gemspec for preinstallation.
# shellcheck disable=SC2086
tar -cf- lang/ruby/Gemfile Dockerfile | docker build $DOCKER_BUILD_XTRA_ARGS -t "$DOCKER_IMAGE_NAME" -
tar -cf- Dockerfile $DOCKER_EXTRA_CONTEXT | docker build $DOCKER_BUILD_XTRA_ARGS -t "$DOCKER_IMAGE_NAME" -
rm Dockerfile
# By mapping the .m2 directory you can do an mvn install from
# within the container and use the result on your normal
Expand Down Expand Up @@ -336,7 +340,7 @@ do
;;

docker-test)
tar -cf- share/docker/Dockerfile lang/ruby/Gemfile |
tar -cf- share/docker/Dockerfile $DOCKER_EXTRA_CONTEXT |
docker build -t avro-test -f share/docker/Dockerfile -
docker run --rm -v "${PWD}:/avro${DOCKER_MOUNT_FLAG}" --env "JAVA=${JAVA:-8}" avro-test /avro/share/docker/run-tests.sh
;;
Expand Down
6 changes: 6 additions & 0 deletions share/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ RUN python3 -m pip install --upgrade pip setuptools wheel \
# Install Ruby
RUN apt-get -qqy install ruby-full \
&& apt-get -qqy clean
RUN mkdir -p /tmp/lang/ruby/lib/avro && mkdir -p /tmp/share
COPY lang/ruby/* /tmp/lang/ruby/
COPY share/VERSION.txt /tmp/share/
RUN gem install bundler --no-document && \
apt-get install -qqy libyaml-dev && \
cd /tmp/lang/ruby && bundle install

# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.60.0
Expand Down