diff --git a/.travis.yml b/.travis.yml index 252093a..1e06070 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,9 +37,6 @@ cache: bundler before_script: - mkdir -p tmp/{pids,cache} log -# workaround for plugins with Gemfile - - perl -pi -e 's/--local --quiet/install --jobs=3 --retry=3 > \/dev\/null/' script/noosfero-plugins - - perl -pi -e 's/rm -f \$gemfile/mv "\$gemfile".lock Gemfile.lock; rm -f \$gemfile/' script/noosfero-plugins - script/noosfero-plugins disableall - bundle exec rake makemo &>/dev/null # database @@ -54,7 +51,7 @@ env: - TASK=test:integration - TASK=cucumber - TASK=selenium - - TASK=test:noosfero_plugins + - TASK=test:noosfero_plugins BUNDLE_OPTS=install script: - bundle exec rake $TASK diff --git a/plugins/fb_app/install.rb b/plugins/fb_app/install.rb index fc6ed0b..c7fe6f2 100644 --- a/plugins/fb_app/install.rb +++ b/plugins/fb_app/install.rb @@ -1,2 +1,3 @@ system "script/noosfero-plugins -q enable oauth_client open_graph" +exit $?.exitstatus diff --git a/plugins/open_graph/install.rb b/plugins/open_graph/install.rb index cfba09e..19c293d 100644 --- a/plugins/open_graph/install.rb +++ b/plugins/open_graph/install.rb @@ -1,2 +1,3 @@ system "script/noosfero-plugins -q enable metadata" +exit $?.exitstatus diff --git a/plugins/orders/install.rb b/plugins/orders/install.rb index 156ab46..4e92bcd 100644 --- a/plugins/orders/install.rb +++ b/plugins/orders/install.rb @@ -1,2 +1,3 @@ system "script/noosfero-plugins -q enable delivery" +exit $?.exitstatus diff --git a/plugins/orders_cycle/install.rb b/plugins/orders_cycle/install.rb index add1749..e1e5c27 100644 --- a/plugins/orders_cycle/install.rb +++ b/plugins/orders_cycle/install.rb @@ -1,2 +1,3 @@ system "script/noosfero-plugins -q enable orders suppliers" +exit $?.exitstatus diff --git a/plugins/shopping_cart/install.rb b/plugins/shopping_cart/install.rb index 609d603..f6df1f4 100644 --- a/plugins/shopping_cart/install.rb +++ b/plugins/shopping_cart/install.rb @@ -1,2 +1,3 @@ system "script/noosfero-plugins -q enable orders delivery" +exit $?.exitstatus diff --git a/script/noosfero-plugins b/script/noosfero-plugins index 495dcd2..28d3bc2 100755 --- a/script/noosfero-plugins +++ b/script/noosfero-plugins @@ -77,6 +77,12 @@ run(){ fi } +_install(){ + # export so that recursive enables for dependencies inherit this option too + export BUNDLE_OPTS='install' + _enable "$1" +} + _enable(){ plugin="$1" @@ -113,10 +119,13 @@ _enable(){ if [ -e $source/Gemfile ]; then gemfile=$(mktemp --tmpdir=.) cat $NOOSFERO_DIR/Gemfile $source/Gemfile > $gemfile - if ! RUBYOPT='' BUNDLE_GEMFILE="$gemfile" bundle --local --quiet; then + if [ -z "$BUNDLE_OPTS" ]; then BUNDLE_OPTS="--local"; fi + if ! RUBYOPT='' BUNDLE_GEMFILE="$gemfile" bundle $BUNDLE_OPTS --quiet; then dependencies_ok=false + else + mv "$gemfile".lock Gemfile.lock fi - rm -f $gemfile $gemfile.lock + rm -f $gemfile fi if ! run $dependencies_file; then dependencies_ok=false @@ -134,9 +143,11 @@ _enable(){ elif [ "$installation_ok" = false ]; then echo "W: failed to install $plugin; not enabling" echo + exit 1 elif [ "$dependencies_ok" = false ]; then echo "W: failed to load dependencies for $plugin; not enabling" echo + exit 2 fi fi } @@ -245,7 +256,7 @@ case "$command" in fi _$command ;; - enable|disable|new) + enable|install|disable|new) for plugin in $@; do _$command "$plugin" done -- libgit2 0.21.2