Skip to content

Commit

Permalink
fix installDependencies to work in docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
wildone committed Oct 18, 2019
1 parent 0b6a7a3 commit 025de3f
Showing 1 changed file with 38 additions and 29 deletions.
67 changes: 38 additions & 29 deletions aemdesign-testing/asciidoctor-convert-reports
Original file line number Diff line number Diff line change
Expand Up @@ -115,35 +115,44 @@ function printConfig() {
}

function installDependencies() {

rvm install 2.6
rvm use 2.6 --default

local LOCAL_GEM_USER_PATH=$(ruby -e 'puts Gem.user_dir')
if [[ -z $LOCAL_GEM_USER_PATH ]]; then
local GEM_INSTALL=$(gem install bundler --user-install)
fi

LOCAL_GEM_USER_PATH=$(ruby -e 'puts Gem.user_dir')
LOCAL_BUNDLER=$(which bundler)
if [[ -z "$LOCAL_BUNDLER" ]]; then
LOCAL_BUNDLER="$(find $LOCAL_GEM_USER_PATH/gems/*/exe/* -name bundler)"
fi

local STATUS_CHECK="$($LOCAL_BUNDLER check --path vendor/bundle)"
debug "CHECK RUBY: $STATUS_CHECK"

if [[ ! "$STATUS_CHECK" == *"dependencies are satisfied"* ]]; then
debug "BUNDLER: Installing"
local BUNDLER_STATUS=$($LOCAL_BUNDLER install --path vendor/bundle)
if [[ "$BUNDLER_STATUS" == *"Bundle complete!"* ]]; then
debug "BUNDLER: OK"
else
echo $BUNDLER_STATUS
fi
else
debug "RUBY: OK"
fi
# rvm use ruby-2.6.3
export HOME="."
export PATH=$PATH:/usr/local/rvm/bin
source /usr/local/rvm/src/rvm/scripts/rvm
rvm reload
INSTALLED_RUBY=$(rvm list rubies strings)
rvm use ${INSTALLED_RUBY}
# bundle update --bundler --local
echo "bundle install --path vendor/bundle"
bundle install --path vendor/bundle
# rvm install ruby-2.6.3
# rvm use ruby-2.6.3
#
# local LOCAL_GEM_USER_PATH=$(ruby -e 'puts Gem.user_dir')
# if [[ -z $LOCAL_GEM_USER_PATH ]]; then
# local GEM_INSTALL=$(gem install bundler --user-install)
# fi
#
# LOCAL_GEM_USER_PATH=$(ruby -e 'puts Gem.user_dir')
# LOCAL_BUNDLER=$(which bundler)
# if [[ -z "$LOCAL_BUNDLER" ]]; then
# LOCAL_BUNDLER="$(find $LOCAL_GEM_USER_PATH/gems/*/exe/* -name bundler)"
# fi
#
# local STATUS_CHECK="$($LOCAL_BUNDLER check --path vendor/bundle)"
# debug "CHECK RUBY: $STATUS_CHECK"
#
# if [[ ! "$STATUS_CHECK" == *"dependencies are satisfied"* ]]; then
# debug "BUNDLER: Installing"
# local BUNDLER_STATUS=$($LOCAL_BUNDLER install --path vendor/bundle)
# if [[ "$BUNDLER_STATUS" == *"Bundle complete!"* ]]; then
# debug "BUNDLER: OK"
# else
# echo $BUNDLER_STATUS
# fi
# else
# debug "RUBY: OK"
# fi

}

Expand Down

0 comments on commit 025de3f

Please sign in to comment.