Sha256: 05c1f85d789631fd817e992d0fcde36b4a11a4dd651485e8d418adfbfc0c84dd

Contents?: true

Size: 1001 Bytes

Versions: 4

Compression:

Stored size: 1001 Bytes

Contents

#!/usr/bin/env bash

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

echo " * Run: natives detect"
$PROJECT_HOME/bin/natives detect

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

4 entries across 4 versions & 1 rubygems

Version Path
natives-0.6.2 catalogs_test/bin/install_entry
natives-0.6.1 catalogs_test/bin/install_entry
natives-0.6.0 catalogs_test/bin/install_entry
natives-0.5.5 catalogs_test/bin/install_entry