<commit_before>#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

set -x

pushd resource-pools
  echo "Unclaiming $RESOURCE_NAME"

  if [[ -f "$RESOURCE_TYPE/claimed/$RESOURCE_NAME" || -f "$RESOURCE_TYPE/unclaimed/$RESOURCE_NAME" ]]; then
    if [[ -f "$RESOURCE_TYPE/claimed/$RESOURCE_NAME" ]] ; then
      git mv "$RESOURCE_TYPE/claimed/$RESOURCE_NAME" "$RESOURCE_TYPE/unclaimed/"
      git add "$RESOURCE_TYPE"
      git commit -m "Unclaim $RESOURCE_NAME via $PIPELINE_NAME pipeline"
    elif [[ -f "$RESOURCE_TYPE/unclaimed/$RESOURCE_NAME" ]] ; then
      echo "$RESOURCE_NAME is already unclaimed"
    fi
  else
    echo "$RESOURCE_NAME does not currently exist in pool"
    exit 1
  fi
popd

rsync -a resource-pools/ resource-pools-artifacts<commit_msg>Fail out unclaim-bosh-lite-resource with git operation<commit_after>#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

set -x

pushd resource-pools
  echo "Unclaiming $RESOURCE_NAME"

  if [[ -f "$RESOURCE_TYPE/claimed/$RESOURCE_NAME" || -f "$RESOURCE_TYPE/unclaimed/$RESOURCE_NAME" ]]; then
    if [[ -f "$RESOURCE_TYPE/claimed/$RESOURCE_NAME" ]] ; then
      git mv "$RESOURCE_TYPE/claimed/$RESOURCE_NAME" "$RESOURCE_TYPE/unclaimed/"
      git add "$RESOURCE_TYPE"
      git commit -m "Unclaim $RESOURCE_NAME via $PIPELINE_NAME pipeline"
    elif [[ -f "$RESOURCE_TYPE/unclaimed/$RESOURCE_NAME" ]] ; then
      echo "$RESOURCE_NAME is already unclaimed"
    fi
  else
    echo "$RESOURCE_NAME does not currently exist in pool"
    git mv "$RESOURCE_TYPE/claimed/$RESOURCE_NAME" "$RESOURCE_TYPE/unclaimed/"
  fi
popd

rsync -a resource-pools/ resource-pools-artifacts
{'fraction_non_alphanumeric': 0.11800120409391933, 'fraction_numerical': 0.0006020469596628537, 'mean_word_length': 3.8173913043478263, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4726031', 'n_tokens_mistral': 585, 'n_tokens_neox': 576, 'n_words': 146}