Sha256: fab9da5e98a503fb357bcfb16aacfd0665f81e25fd646b3b78606e9d9dcd0d92

Contents?: true

Size: 937 Bytes

Versions: 1

Compression:

Stored size: 937 Bytes

Contents

#!/usr/bin/env bash

BIN_HOME="$( cd "$( dirname "$0" )" && pwd )"
PROJECT_HOME="$( cd $BIN_HOME/../.. && pwd )"

gem_name=$1
echo " * Gem: $gem_name"

native_packages="$( $PROJECT_HOME/bin/natives list $gem_name )"
echo " * Native packages: $native_packages"

if [ -n "$native_packages" ]; then
  echo " * Installing native packages.."
  max_retry=3
  retry_count=0
  last_status='err'
  while [ $retry_count -lt $max_retry ]; do
    retry_count=$[$retry_count+1]
    echo " * Attempt: $retry_count of $max_retry"

    apt-get install -y $native_packages

    if [ $? -eq 0 ]; then
      last_status='ok'
      break
    fi
  done
  if [ $last_status == 'err' ]; then
    echo " * Abort. Error when installing native packages."
    return 1
  fi
fi

echo " * Installing gems.."
gem install --verbose $gem_name

EXIT_CODE=$?
echo " * Exit code: $EXIT_CODE"

echo ""
if [ $EXIT_CODE -eq 0 ]; then
  echo "SUCCESS"
else
  echo "FAILED"
fi

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
natives-0.5.4 catalogs_test/bin/install_entry