Sha256: c28a6f4efd779d28ed4237b35d94e2a62afd1a40798285c64b23cd29eb5d7635

Contents?: true

Size: 1.41 KB

Versions: 2

Compression:

Stored size: 1.41 KB

Contents

#!/usr/bin/env bash

set -e

case "$DB" in
postgres|postgresql)
  RAILSDB="postgresql"
  ;;
mysql)
  RAILSDB="mysql"
  ;;
sqlite|'')
  RAILSDB="sqlite3"
  ;;
*)
  echo "Invalid DB specified: $DB"
  exit 1
  ;;
esac

if [ ! -z $SOLIDUS_BRANCH ]
then
  BRANCH=$SOLIDUS_BRANCH
else
  BRANCH="master"
fi

extension_name="solidus_paypal_commerce_platform"

# Stay away from the bundler env of the containing extension.
function unbundled {
  ruby -rbundler -e'b = proc {system *ARGV}; Bundler.respond_to?(:with_unbundled_env) ? Bundler.with_unbundled_env(&b) : Bundler.with_clean_env(&b)' -- "$@"
}

rm -rf ./sandbox
unbundled bundle exec rails new sandbox --database="$RAILSDB" \
  --skip-bundle \
  --skip-git \
  --skip-keeps \
  --skip-rc \
  --skip-spring \
  --skip-test \
  --skip-javascript

if [ ! -d "sandbox" ]; then
  echo 'sandbox rails application failed'
  exit 1
fi

cd ./sandbox
unbundled bundle add solidus --github solidusio/solidus --branch "${BRANCH:-master}" --version '> 0.a'
unbundled bundle exec rake db:drop db:create
unbundled bundle exec rails generate solidus:install --auto-accept "$@"

echo
echo "🚀 Sandbox app successfully created for $extension_name!"
echo "🚀 Using $RAILSDB and Solidus $BRANCH"
echo "🚀 Use 'export DB=[postgres|mysql|sqlite]' to control the DB adapter"
echo "🚀 Use 'export SOLIDUS_BRANCH=<BRANCH-NAME>' to control the Solidus version"
echo "🚀 This app is intended for test purposes."

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
solidus_paypal_commerce_platform-1.0.0.beta2 bin/sandbox
solidus_paypal_commerce_platform-1.0.0.beta1 bin/sandbox