32 lines
913 B
Bash
Executable File
32 lines
913 B
Bash
Executable File
#!/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}"
|
|
|
|
source /etc/os-release
|
|
|
|
# 3.13.alpine.gems.sutty.nl
|
|
# rolling.arch.gems.sutty.nl
|
|
# 18.04.ubuntu.gems.sutty.nl
|
|
OS_VERSION="$(os-version)"
|
|
RUBY_GEMS="https://${HTTP_BASIC_USER}:${HTTP_BASIC_PASSWORD}@${OS_VERSION}.${ID}.gems.${SUTTY}"
|
|
|
|
cd cache/
|
|
gem fetch --source=https://rubygems.org --platform=ruby --version ${GEM_VERSION} ${GEM_NAME}
|
|
|
|
cd ../gems/
|
|
gem compile -V --prune --strip "strip --strip-unneeded" ${GEM_COMPILER_FLAGS} "../cache/${GEM_NAME}-${GEM_VERSION}.gem"
|
|
|
|
if test -f "${GEM_NAME}-${GEM_VERSION}-${PLATFORM}.gem"; then
|
|
gem inabox -o "${GEM_NAME}-${GEM_VERSION}-${PLATFORM}.gem" --host "${RUBY_GEMS}"
|
|
fi
|
|
|
|
if test -f "${GEM_NAME}-${GEM_VERSION}.gem"; then
|
|
gem inabox -o "${GEM_NAME}-${GEM_VERSION}.gem" --host "${RUBY_GEMS}"
|
|
fi
|