<commit_before>#!/bin/bash
set -e

# Start the ssh-agent and save the information; we'll need it later
SSH_AGENT=$(ssh $IMAGE_USER@$IMAGE_HOST ssh-agent)

function run_via_ssh() {
  cmd=$1
  echo "Running: '$cmd'"
  ssh $IMAGE_USER@$IMAGE_HOST "$cmd"
}

ssh $IMAGE_USER@$IMAGE_HOST "
  eval $SSH_AGENT
  ssh-add  ~/.ssh/id_github_private ;
  ( ssh -o StrictHostKeyChecking=no git@github.com exit; : ) &&
  cd /tmp &&
  git clone https://github.com/pivotal-sprout/sprout-orchard.git &&
  git clone $SPROUT_WRAP_GIT_URL sprout-wrap"

if [[ $PIVOTAL_LABS != "0" ]]; then
  ssh $IMAGE_USER@$IMAGE_HOST "
    eval $SSH_AGENT
    cd /tmp &&
    git clone <EMAIL>:pivotal/pivotal_workstation_private.git &&
    echo 'cookbook '\''pivotal_workstation_private'\'', :path => '\''/tmp/pivotal_workstation_private'\''' >> /tmp/sprout-wrap/Cheffile"
fi

NOKOGIRI_INSTALL='mkdir /tmp/libiconv
  cd /tmp/libiconv
  curl -OL http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
  tar xvfz libiconv-1.13.1.tar.gz
  cd libiconv-1.13.1
  ./configure --prefix=/usr/local/Cellar/libiconv/1.13.1
  make
  sudo make install
  sudo gem install nokogiri -- --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib'

run_via_ssh 'sudo pmset sleep 0' # prevent machine from sleeping (otherwise will lose build)
run_via_ssh 'sudo gem update --system'
run_via_ssh 'sudo gem install bundler --no-rdoc --no-ri'
run_via_ssh "$NOKOGIRI_INSTALL"
run_via_ssh 'cd /tmp/sprout-wrap && sudo bundle install || true' # so that git: https://github.com/acrmp/foodcritic is on disk
run_via_ssh 'cd /tmp/sprout-wrap && sudo bundle install --without development'
run_via_ssh 'cat /tmp/sprout-wrap/.bundle/config'
run_via_ssh 'cd /tmp/sprout-wrap && bundle exec soloist'
#  curl -LO https://github.com/pivotal-sprout/omnibus-soloist/releases/download/1.0.1/install.sh &&
#  sudo bash install.sh &&
#  PATH+=:/opt/soloist/bin/ &&
#  cd /tmp/sprout-wrap &&
#  soloist"

if [[ $PIVOTAL_LABS != "0" ]]; then
  ssh $IMAGE_USER@$IMAGE_HOST "
    eval $SSH_AGENT
    PATH+=:/opt/soloist/bin/
    cd /tmp/sprout-wrap &&
    bundle exec soloist run_recipe meta::pivotal_specifics &&
    bundle exec soloist run_recipe pivotal_workstation_private::meta_lion_image"
  # Successful run, in the future we should tag
fi
<commit_msg>Shouldn't need to `bundle install` twice<commit_after>#!/bin/bash
set -e

# Start the ssh-agent and save the information; we'll need it later
SSH_AGENT=$(ssh $IMAGE_USER@$IMAGE_HOST ssh-agent)

function run_via_ssh() {
  cmd=$1
  echo "Running: '$cmd'"
  ssh $IMAGE_USER@$IMAGE_HOST "$cmd"
}

ssh $IMAGE_USER@$IMAGE_HOST "
  eval $SSH_AGENT
  ssh-add  ~/.ssh/id_github_private ;
  ( ssh -o StrictHostKeyChecking=no git@github.com exit; : ) &&
  cd /tmp &&
  git clone https://github.com/pivotal-sprout/sprout-orchard.git &&
  git clone $SPROUT_WRAP_GIT_URL sprout-wrap"

if [[ $PIVOTAL_LABS != "0" ]]; then
  ssh $IMAGE_USER@$IMAGE_HOST "
    eval $SSH_AGENT
    cd /tmp &&
    git clone <EMAIL>:pivotal/pivotal_workstation_private.git &&
    echo 'cookbook '\''pivotal_workstation_private'\'', :path => '\''/tmp/pivotal_workstation_private'\''' >> /tmp/sprout-wrap/Cheffile"
fi

NOKOGIRI_INSTALL='mkdir /tmp/libiconv
  cd /tmp/libiconv
  curl -OL http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
  tar xvfz libiconv-1.13.1.tar.gz
  cd libiconv-1.13.1
  ./configure --prefix=/usr/local/Cellar/libiconv/1.13.1
  make
  sudo make install
  sudo gem install nokogiri -- --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib'

run_via_ssh 'sudo pmset sleep 0' # prevent machine from sleeping (otherwise will lose build)
run_via_ssh 'sudo gem update --system'
run_via_ssh 'sudo gem install bundler --no-rdoc --no-ri'
run_via_ssh "$NOKOGIRI_INSTALL"
run_via_ssh 'cd /tmp/sprout-wrap && sudo bundle install && bundle exec soloist''
#  curl -LO https://github.com/pivotal-sprout/omnibus-soloist/releases/download/1.0.1/install.sh &&
#  sudo bash install.sh &&
#  PATH+=:/opt/soloist/bin/ &&
#  cd /tmp/sprout-wrap &&
#  soloist"

if [[ $PIVOTAL_LABS != "0" ]]; then
  ssh $IMAGE_USER@$IMAGE_HOST "
    eval $SSH_AGENT
    PATH+=:/opt/soloist/bin/
    cd /tmp/sprout-wrap &&
    bundle exec soloist run_recipe meta::pivotal_specifics &&
    bundle exec soloist run_recipe pivotal_workstation_private::meta_lion_image"
  # Successful run, in the future we should tag
fi

{'fraction_non_alphanumeric': 0.14576346970713167, 'fraction_numerical': 0.013860943438408227, 'mean_word_length': 3.894967177242888, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1824324', 'n_tokens_mistral': 1851, 'n_tokens_neox': 1743, 'n_words': 359}