Sha256: e6ab89c0be7562a2926884c3c1724b2a07e0e7bf6d9c3ce6e039e07e2c3896e0

Contents?: true

Size: 1.66 KB

Versions: 217

Compression:

Stored size: 1.66 KB

Contents

#!/bin/bash --login
if [[ $CRYPTUM_ROOT == '' ]]; then
  if [[ ! -d '/opt/cryptum' ]]; then
    cryptum_root=$(pwd)
  else
    cryptum_root='/opt/cryptum'
  fi
else
  cryptum_root="${CRYPTUM_ROOT}"
fi

ls pkg/*.gem 2> /dev/null | while read previous_gems; do 
  rvmsudo rm $previous_gems
done
old_ruby_version=`cat ${cryptum_root}/.ruby-version`
# Default Strategy is to merge codebase
# rvmsudo git config pull.rebase false 
# rvmsudo git pull origin master
git config pull.rebase false 
git pull origin master
new_ruby_version=`cat ${cryptum_root}/.ruby-version`

rvm list gemsets | grep `cat ${cryptum_root}/.ruby-gemset`
if [[ $? != 0 ]]; then
  echo "Ruby v${new_ruby_version} is not installed.  Installing..."
  cd $cryptum_root && ./upgrade_ruby.sh $new_ruby_version
  # Rely on RVM to creeate gemset
  cd / && cd $cryptum_root
fi

if [[ $old_ruby_version == $new_ruby_version ]]; then
  export rvmsudo_secure_path=1
  rvmsudo /bin/bash --login -c "cd ${cryptum_root} && ./reinstall_cryptum_gemset.sh"
  rvmsudo rake
  rvmsudo rake install
  rvmsudo rake rerdoc
  rvmsudo gem update --system
  rvmsudo gem rdoc --rdoc --ri --overwrite -V cryptum
  echo "Invoking bundle-audit Gemfile Scanner..."
  rvmsudo bundle-audit

  latest_gem=$(ls pkg/*.gem)
  if [[ $latest_gem != "" ]]; then
    echo "Pushing ${latest_gem} to RubyGems.org..."
    rvmsudo gem push $latest_gem --debug
  fi
else
  cd $cryptum_root && ./upgrade_ruby.sh $new_ruby_version $old_ruby_version
fi

unpriv_user=`echo $USER`
if [[ $unpriv_user != 'root' ]]; then
  if [[ $(uname -s) == 'Darwin' ]]; then
    rvmsudo chown -R $unpriv_user $cryptum_root
  else
    rvmsudo chown -R $unpriv_user:$unpriv_user $cryptum_root
  fi
fi

Version data entries

217 entries across 217 versions & 1 rubygems

Version Path
cryptum-0.0.406 build_cryptum_gem.sh
cryptum-0.0.405 build_cryptum_gem.sh
cryptum-0.0.404 build_cryptum_gem.sh
cryptum-0.0.403 build_cryptum_gem.sh
cryptum-0.0.402 build_cryptum_gem.sh
cryptum-0.0.401 build_cryptum_gem.sh
cryptum-0.0.400 build_cryptum_gem.sh
cryptum-0.0.399 build_cryptum_gem.sh
cryptum-0.0.398 build_cryptum_gem.sh
cryptum-0.0.397 build_cryptum_gem.sh
cryptum-0.0.396 build_cryptum_gem.sh
cryptum-0.0.395 build_cryptum_gem.sh
cryptum-0.0.394 build_cryptum_gem.sh
cryptum-0.0.393 build_cryptum_gem.sh
cryptum-0.0.392 build_cryptum_gem.sh
cryptum-0.0.389 build_cryptum_gem.sh
cryptum-0.0.388 build_cryptum_gem.sh
cryptum-0.0.387 build_cryptum_gem.sh
cryptum-0.0.386 build_cryptum_gem.sh
cryptum-0.0.385 build_cryptum_gem.sh