<commit_before>#!/bin/bash

set -eu

function cleanup {
  if [[ -f $tmpfile ]]; then
    rm $tmpfile
  fi
}

trap cleanup EXIT

tmpfile=$(mktemp)

IFS=$'\n'

function write_params() {
  local file=$1
  local prefix=$2
  local key=$3
  local note_path=$4
  local lpass_path="Shared-Customer [0]/${note_path}"
  local contents=$(lpass show $lpass_path  --notes)

  if [[ -z "$contents" ]]; then
    echo Could not fetch contents from $lpass_path
    exit 1
  fi

  cat >> $file <<EOF
$prefix$key: |
EOF

  for line in $contents; do
    echo "  ${prefix}${line}" >> $file
  done
}

write_params $tmpfile "" "install_pcf_aws_current_params" 'lre1-aws/install-pcf-params'
write_params $tmpfile "" "upgrade_ert_aws_current_params" 'lre1-aws/ert-upgrade-params'
write_params $tmpfile "" "upgrade_ops_manager_aws_current_params" 'lre1-aws/upgrade-ops-man-params'
write_params $tmpfile "" "install_pcf_gcp_current_params" 'lre1-gcp/install-pcf-params'
write_params $tmpfile "" "upgrade_ert_gcp_current_params" 'lre1-gcp/install-pcf-params'
write_params $tmpfile "" "apply_updates_gcp_current_params" 'lre1-gcp/apply-updates-params'
write_params $tmpfile "" "upgrade_ops_manager_gcp_current_params" 'lre1-gcp/opsman-upgrade-params'
write_params $tmpfile "" "install_pcf_azure_current_params" 'lre1-azure/install-pcf-params'
write_params $tmpfile "" "install_pcf_vsphere_slot1_params" 'vsphere-slot1/install-pcf-params'
write_params $tmpfile "" "upgrade_ert_vsphere_slot1_params" 'vsphere-slot1/upgrade-ert-params'
write_params $tmpfile "" "upgrade_ops_manager_vsphere_slot1_params" 'vsphere-slot1/upgrade-ops-manager-params'<commit_msg>Fix ci test error in for upgrade-ert-gcp pipeline<commit_after>#!/bin/bash

set -eu

function cleanup {
  if [[ -f $tmpfile ]]; then
    rm $tmpfile
  fi
}

trap cleanup EXIT

tmpfile=$(mktemp)

IFS=$'\n'

function write_params() {
  local file=$1
  local prefix=$2
  local key=$3
  local note_path=$4
  local lpass_path="Shared-Customer [0]/${note_path}"
  local contents=$(lpass show $lpass_path  --notes)

  if [[ -z "$contents" ]]; then
    echo Could not fetch contents from $lpass_path
    exit 1
  fi

  cat >> $file <<EOF
$prefix$key: |
EOF

  for line in $contents; do
    echo "  ${prefix}${line}" >> $file
  done
}

write_params $tmpfile "" "install_pcf_aws_current_params" 'lre1-aws/install-pcf-params'
write_params $tmpfile "" "upgrade_ert_aws_current_params" 'lre1-aws/ert-upgrade-params'
write_params $tmpfile "" "upgrade_ops_manager_aws_current_params" 'lre1-aws/upgrade-ops-man-params'
write_params $tmpfile "" "install_pcf_gcp_current_params" 'lre1-gcp/install-pcf-params'
write_params $tmpfile "" "upgrade_ert_gcp_current_params" 'lre1-gcp/ert-upgrade-params'
write_params $tmpfile "" "apply_updates_gcp_current_params" 'lre1-gcp/apply-updates-params'
write_params $tmpfile "" "upgrade_ops_manager_gcp_current_params" 'lre1-gcp/opsman-upgrade-params'
write_params $tmpfile "" "install_pcf_azure_current_params" 'lre1-azure/install-pcf-params'
write_params $tmpfile "" "install_pcf_vsphere_slot1_params" 'vsphere-slot1/install-pcf-params'
write_params $tmpfile "" "upgrade_ert_vsphere_slot1_params" 'vsphere-slot1/upgrade-ert-params'
write_params $tmpfile "" "upgrade_ops_manager_vsphere_slot1_params" 'vsphere-slot1/upgrade-ops-manager-params'
{'fraction_non_alphanumeric': 0.12895377128953772, 'fraction_numerical': 0.012165450121654502, 'mean_word_length': 5.739754098360656, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '1345617', 'n_tokens_mistral': 1259, 'n_tokens_neox': 1221, 'n_words': 220}