Sha256: 2127828d502178a2e389d1189bb0f3b860f011e76ac763c6f4c5402d90253789

Contents?: true

Size: 1.71 KB

Versions: 4

Compression:

Stored size: 1.71 KB

Contents

#!/usr/bin/env bash

set -e
test -z "${DEBUG+empty_string}" || set -x

test "$DB" = "sqlite" && export DB="sqlite3"

if [ -z "$PAYMENT_METHOD" ]
then
  PAYMENT_METHOD="none"
fi

if [ -z "$SOLIDUS_BRANCH" ]
then
  echo "~~> Use 'export SOLIDUS_BRANCH=[main|v4.0|...]' to control the Solidus branch"
  SOLIDUS_BRANCH="main"
fi
echo "~~> Using branch $SOLIDUS_BRANCH of solidus"

extension_name="solidus_act_as_tenant"

# Stay away from the bundler env of the containing extension.
function unbundled {
  ruby -rbundler -e'
      Bundler.with_unbundled_env {system *ARGV}' -- \
        env BUNDLE_SUPPRESS_INSTALL_USING_MESSAGES=true $@
}

echo "~~~> Removing the old sandbox"
rm -rf ./sandbox

echo "~~~> Creating a pristine Rails app"
rails new sandbox \
  --database="${DB:-sqlite3}" \
  --skip-git \
  --skip-keeps \
  --skip-rc \
  --skip-bootsnap \
  --skip-test

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

echo "~~~> Adding solidus (with i18n) to the Gemfile"
cd ./sandbox
cat <<RUBY >> Gemfile
gem 'solidus', github: 'solidusio/solidus', branch: '$SOLIDUS_BRANCH'
gem 'rails-i18n'
gem 'solidus_i18n'
gem 'solidus_auth_devise'

gem '$extension_name', path: '..'

group :test, :development do
  platforms :mri do
    gem 'pry-byebug'
  end
end
RUBY

unbundled bundle install --gemfile Gemfile

unbundled bundle exec rake db:drop db:create

unbundled bundle exec rails generate solidus:install \
  --auto-accept \
  $@

unbundled bundle exec rails generate solidus:auth:install --auto-run-migrations
unbundled bundle exec rails generate ${extension_name}:install --auto-run-migrations

echo
echo "๐Ÿš€ Sandbox app successfully created for $extension_name!"
echo "๐Ÿงช This app is intended for test purposes."

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
solidus_act_as_tenant-0.0.4 bin/sandbox
solidus_act_as_tenant-0.0.3 bin/sandbox
solidus_act_as_tenant-0.0.2 bin/sandbox
solidus_act_as_tenant-0.0.1 bin/sandbox