containers-gem-compiler/gem-compiler.sh

18 lines
560 B
Bash
Raw Normal View History

2021-09-29 19:19:40 +00:00
#!/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}"
2021-09-30 00:11:17 +00:00
cd cache/
2021-09-29 19:19:40 +00:00
# TODO: Support multiple Alpine/Ruby versions
2021-09-30 00:11:17 +00:00
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}