simplify for ci
Some checks failed
continuous-integration/drone the build failed

This commit is contained in:
f 2021-09-29 16:19:40 -03:00
parent 8d1fa48e7a
commit d2a6ac4e1d
4 changed files with 18 additions and 34 deletions

View file

@ -11,9 +11,10 @@ ENV HTTP_BASIC_PASSWORD=gibberish
ENV NOKOGIRI_USE_SYSTEM_LIBRARIES=1
ENV EXTRA_PKGS=''
RUN id
RUN gem install --no-user-install --no-document --source https://rubygems.org geminabox mini_portile2 gem-compiler
COPY ./gemcompiler.sh /usr/local/bin/gemcompiler
COPY ./gem-compiler.sh /usr/local/bin/gem-compiler
COPY ./bootstrap.sh /usr/local/bin/bootstrap
RUN install -dm 2750 -o builder -g builder /srv/gems
@ -21,4 +22,4 @@ VOLUME /srv/gems
RUN apk add --no-cache su-exec file-dev libssh2-dev libc6-compat libstdc++
ENTRYPOINT /usr/local/bin/bootstrap
ENTRYPOINT /bin/sh

View file

@ -1,7 +1,6 @@
#!/bin/sh
set -e
set -x
test -n "${EXTRA_PKGS}" && apk add --no-cache ${EXTRA_PKGS}
su-exec builder /usr/local/bin/gemcompiler
su-exec builder /usr/local/bin/gem-compiler

14
gem-compiler.sh Executable file
View file

@ -0,0 +1,14 @@
#!/bin/sh
set -e
test -n "${GEM_NAME}"
test -n "${GEM_VERSION}"
test -n "${HTTP_BASIC_USER}"
test -n "${HTTP_BASIC_PASSWORD}"
test -n "${SUTTY}"
test -n "${PLATFORM}"
# TODO: Support multiple Alpine/Ruby versions
gem fetch --source=https://gems.${SUTTY} --platform=ruby --version ${VERSION} ${GEM}
gem compile -V --prune --strip "strip --strip-unneeded" "${GEM}-${VERSION}.gem"
gem inabox -o "${GEM}-${VERSION}-${PLATFORM}.gem" --host https://${HTTP_BASIC_USER}:${HTTP_BASIC_PASSWORD}@gems.${SUTTY}

View file

@ -1,30 +0,0 @@
#!/bin/sh
set -e
# CCache
export PATH=/usr/lib/ccache/bin:$PATH
source /etc/os-release
alpine_version="${VERSION_ID%.*}"
platform="`ruby -e "puts RbConfig::CONFIG['arch']"`"
gems_dir="${GEMS_DIR:-/srv/gems}"
cache_dir="${gems_dir}/cache"
release_dir="${RELEASE_DIR:-${gems_dir}/${alpine_version}}"
mkdir -p "${cache_dir}" "${release_dir}"
gem="${GEM}-${VERSION}.gem"
release="${GEM}-${VERSION}-${platform}.gem"
if ! test -f "${cache_dir}/${gem}" ; then
cd "${cache_dir}"
gem fetch --source=https://gems.${SUTTY} --platform=ruby --version ${VERSION} ${GEM}
fi
if ! test -f "${release_dir}/${release}"; then
cd "${release_dir}"
gem compile -V --prune --strip "strip --strip-unneeded" "${cache_dir}/${gem}"
fi
test -f "${release_dir}/${release}" \
&& gem inabox -o "${release_dir}/${release}" --host https://${HTTP_BASIC_USER}:${HTTP_BASIC_PASSWORD}@gems.${SUTTY}