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>"
|
MAINTAINER "f <f@sutty.nl>"
|
||||||
|
|
||||||
ENV PLATFORM=x86_64-linux-musl
|
ENV PLATFORM=x86_64-linux-musl
|
||||||
ENV GEM=none
|
ENV GEM_NAME=none
|
||||||
ENV VERSION=0
|
ENV GEM_VERSION=0
|
||||||
ENV SUTTY=sutty.nl
|
ENV SUTTY=sutty.nl
|
||||||
ENV HTTP_BASIC_USER=sutty
|
ENV HTTP_BASIC_USER=sutty
|
||||||
ENV HTTP_BASIC_PASSWORD=gibberish
|
ENV HTTP_BASIC_PASSWORD=gibberish
|
||||||
|
|
|
@ -2,5 +2,6 @@
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
test -n "${EXTRA_PKGS}" && apk add --no-cache ${EXTRA_PKGS}
|
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
|
su-exec builder /usr/local/bin/gem-compiler
|
||||||
|
|
|
@ -6,6 +6,8 @@ test -n "${HTTP_BASIC_PASSWORD}"
|
||||||
test -n "${SUTTY}"
|
test -n "${SUTTY}"
|
||||||
test -n "${PLATFORM}"
|
test -n "${PLATFORM}"
|
||||||
|
|
||||||
|
install -dm 755 -o builder -g builder cache gems
|
||||||
|
|
||||||
find build/ -type f |
|
find build/ -type f |
|
||||||
sed -re "s|^build/([^/]+)/(.*)|&\tbuilt/${ALPINE_VERSION}/\1/\2\t\1\t\2|" |
|
sed -re "s|^build/([^/]+)/(.*)|&\tbuilt/${ALPINE_VERSION}/\1/\2\t\1\t\2|" |
|
||||||
while read BUILD BUILT GEM_NAME GEM_VERSION; do
|
while read BUILD BUILT GEM_NAME GEM_VERSION; do
|
||||||
|
@ -20,6 +22,7 @@ find build/ -type f |
|
||||||
GEM_NAME="${GEM_NAME}" \
|
GEM_NAME="${GEM_NAME}" \
|
||||||
GEM_VERSION="${GEM_VERSION}" \
|
GEM_VERSION="${GEM_VERSION}" \
|
||||||
EXTRA_PKGS="${EXTRA_PKGS}" \
|
EXTRA_PKGS="${EXTRA_PKGS}" \
|
||||||
|
EXTRA_GEMS="${EXTRA_GEMS}" \
|
||||||
/usr/local/bin/bootstrap
|
/usr/local/bin/bootstrap
|
||||||
|
|
||||||
dirname "${BUILT}" | xargs mkdir -p
|
dirname "${BUILT}" | xargs mkdir -p
|
||||||
|
|
|
@ -8,7 +8,10 @@ test -n "${HTTP_BASIC_PASSWORD}"
|
||||||
test -n "${SUTTY}"
|
test -n "${SUTTY}"
|
||||||
test -n "${PLATFORM}"
|
test -n "${PLATFORM}"
|
||||||
|
|
||||||
|
cd cache/
|
||||||
# TODO: Support multiple Alpine/Ruby versions
|
# TODO: Support multiple Alpine/Ruby versions
|
||||||
gem fetch --source=https://gems.${SUTTY} --platform=ruby --version ${VERSION} ${GEM}
|
gem fetch --source=https://gems.${SUTTY} --platform=ruby --version ${GEM_VERSION} ${GEM_NAME}
|
||||||
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}
|
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