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

source `dirname $0`/shared.inc

function matroshka {
  echo Push the testing branch into the staging one. Ensure that staging remains a
  echo subset of testing, which remains a subset of master, by also pulling in
  echo changes from those branches. If this all works, push the results to origin.
  git checkout staging
  git merge testing

  git checkout testing
  git merge staging

  git checkout master
  git pull              # There may be development changes
  git merge testing

  git push
  echo
}

changed=`cat $CHANGED_COOKBOOKS`

pantry_branch "testing"

for homebase in $HOMEBASES; do
  cd $WORKSPACE/$homebase
  pwd
  echo "Install testing cookbooks, upload and freeze those which changed this run"
  berkshelf --path cookbooks
  knife cookbook upload -V --freeze $changed
  echo

  echo "Record the cookbook versions to the staging environment"
  git checkout staging
  VERSIONS=environments/cookbook_versions.rb
  cat $ROOT_DIR/cookbook_versions.rb.h > $VERSIONS
  for target in `ls -1d cookbooks/*`; do
    cookbook=${target#cookbooks/}
    version=`cat cookbooks/$cookbook/VERSION`
    echo -e "\$cookbooks['$cookbook']\t= '$version'" >> $VERSIONS
  done
  knife environment from file staging.rb
  git commit $VERSIONS -m"$VERSIONS: updating staged versions"
  echo

  matroshka
done
<commit_msg>jenkins_integration: add force to more checkouts<commit_after>#!/usr/bin/env bash
set -e

source `dirname $0`/shared.inc

function matroshka {
  echo Push the testing branch into the staging one. Ensure that staging remains a
  echo subset of testing, which remains a subset of master, by also pulling in
  echo changes from those branches. If this all works, push the results to origin.
  git checkout -f staging
  git merge testing

  git checkout -f testing
  git merge staging

  git checkout -f master
  git pull              # There may be development changes
  git merge testing

  git push
  echo
}

changed=`cat $CHANGED_COOKBOOKS`

pantry_branch "testing"

for homebase in $HOMEBASES; do
  cd $WORKSPACE/$homebase
  pwd
  echo "Install testing cookbooks, upload and freeze those which changed this run"
  berkshelf --path cookbooks
  knife cookbook upload -V --freeze $changed
  echo

  echo "Record the cookbook versions to the staging environment"
  git checkout -f staging
  VERSIONS=environments/cookbook_versions.rb
  cat $ROOT_DIR/cookbook_versions.rb.h > $VERSIONS
  for target in `ls -1d cookbooks/*`; do
    cookbook=${target#cookbooks/}
    version=`cat cookbooks/$cookbook/VERSION`
    echo -e "\$cookbooks['$cookbook']\t= '$version'" >> $VERSIONS
  done
  knife environment from file staging.rb
  git commit $VERSIONS -m"$VERSIONS: updating staged versions"
  echo

  matroshka
done

{'fraction_non_alphanumeric': 0.07202316322837496, 'fraction_numerical': 0.0014477017734346724, 'mean_word_length': 3.7167235494880546, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2768610', 'n_tokens_mistral': 860, 'n_tokens_neox': 818, 'n_words': 329}