parent
7077d4b047
commit
09abf6fb9f
4 changed files with 12 additions and 5 deletions
|
@ -4,8 +4,8 @@ FROM ${BASE_IMAGE}:${ALPINE_VERSION}
|
|||
MAINTAINER "f <f@sutty.nl>"
|
||||
|
||||
ENV PLATFORM=x86_64-linux-musl
|
||||
ENV GEM=none
|
||||
ENV VERSION=0
|
||||
ENV GEM_NAME=none
|
||||
ENV GEM_VERSION=0
|
||||
ENV SUTTY=sutty.nl
|
||||
ENV HTTP_BASIC_USER=sutty
|
||||
ENV HTTP_BASIC_PASSWORD=gibberish
|
||||
|
|
|
@ -2,5 +2,6 @@
|
|||
set -e
|
||||
|
||||
test -n "${EXTRA_PKGS}" && apk add --no-cache ${EXTRA_PKGS}
|
||||
test -n "${EXTRA_GEMS}" && gem install --no-user-install --no-document ${EXTRA_GEMS}
|
||||
|
||||
su-exec builder /usr/local/bin/gem-compiler
|
||||
|
|
|
@ -6,6 +6,8 @@ test -n "${HTTP_BASIC_PASSWORD}"
|
|||
test -n "${SUTTY}"
|
||||
test -n "${PLATFORM}"
|
||||
|
||||
install -dm 755 -o builder -g builder cache gems
|
||||
|
||||
find build/ -type f |
|
||||
sed -re "s|^build/([^/]+)/(.*)|&\tbuilt/${ALPINE_VERSION}/\1/\2\t\1\t\2|" |
|
||||
while read BUILD BUILT GEM_NAME GEM_VERSION; do
|
||||
|
@ -20,6 +22,7 @@ find build/ -type f |
|
|||
GEM_NAME="${GEM_NAME}" \
|
||||
GEM_VERSION="${GEM_VERSION}" \
|
||||
EXTRA_PKGS="${EXTRA_PKGS}" \
|
||||
EXTRA_GEMS="${EXTRA_GEMS}" \
|
||||
/usr/local/bin/bootstrap
|
||||
|
||||
dirname "${BUILT}" | xargs mkdir -p
|
||||
|
|
|
@ -8,7 +8,10 @@ test -n "${HTTP_BASIC_PASSWORD}"
|
|||
test -n "${SUTTY}"
|
||||
test -n "${PLATFORM}"
|
||||
|
||||
cd cache/
|
||||
# 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}
|
||||
gem fetch --source=https://gems.${SUTTY} --platform=ruby --version ${GEM_VERSION} ${GEM_NAME}
|
||||
|
||||
cd ../gems/
|
||||
gem compile -V --prune --strip "strip --strip-unneeded" "../cache/${GEM_NAME}-${GEM_VERSION}.gem"
|
||||
gem inabox -o "${GEM_NAME}-${GEM_VERSION}-${PLATFORM}.gem" --host https://${HTTP_BASIC_USER}:${HTTP_BASIC_PASSWORD}@gems.${SUTTY}
|
||||
|
|
Loading…
Reference in a new issue