<commit_before>#!/bin/bash

set -e

release_version=$(cat version/number)

FINAL_RELEASE_TARBALL=$PWD/final-release-tarball
FINAL_RELEASE_REPO=$PWD/final-release-repo

CANDIDATE_DIR=$PWD/candidate-release

git clone boshrelease $FINAL_RELEASE_REPO
cd $FINAL_RELEASE_REPO

release_name=$(bosh2 int config/final.yml --path /final_name)

cat > config/private.yml << EOF
---
blobstore:
  provider: s3
  options:
    access_key_id: ${aws_access_key_id}
    secret_access_key: ${aws_secret_access_key}
EOF

if [[ -z "$(git config --global user.name)" ]]
then
  git config --global user.name "Concourse Bot"
  git config --global user.email "<EMAIL>"
fi

RELEASE_YML=$PWD/releases/${release_name}/${release_name}-${release_version}.yml
RELEASE_TGZ=$PWD/releases/${release_name}/${release_name}-${release_version}.tgz

if [ -e ${RELEASE_YML} ]; then
  echo "release already created from previous job; making tarball..."
  bosh -n create release --with-tarball ${RELEASE_YML}
else
  echo "finalizing release"
  bosh2 -n finalize-release --version "$release_version" ${CANDIDATE_DIR}/${release_name}-*.tgz
  git add -A
  git commit -m "release v${release_version}"
fi

mv ${RELEASE_TGZ} ${FINAL_RELEASE_TARBALL}<commit_msg>bosh2 create-release to create tarball<commit_after>#!/bin/bash

set -e

release_version=$(cat version/number)

FINAL_RELEASE_TARBALL=$PWD/final-release-tarball
FINAL_RELEASE_REPO=$PWD/final-release-repo

CANDIDATE_DIR=$PWD/candidate-release

git clone boshrelease $FINAL_RELEASE_REPO
cd $FINAL_RELEASE_REPO

release_name=$(bosh2 int config/final.yml --path /final_name)

cat > config/private.yml << EOF
---
blobstore:
  provider: s3
  options:
    access_key_id: ${aws_access_key_id}
    secret_access_key: ${aws_secret_access_key}
EOF

if [[ -z "$(git config --global user.name)" ]]
then
  git config --global user.name "Concourse Bot"
  git config --global user.email "<EMAIL>"
fi

RELEASE_YML=$PWD/releases/${release_name}/${release_name}-${release_version}.yml
RELEASE_TGZ=$PWD/releases/${release_name}/${release_name}-${release_version}.tgz

if [ -e ${RELEASE_YML} ]; then
  echo "release already created from previous job; making tarball..."
else
  echo "finalizing release"
  bosh2 -n finalize-release --version "$release_version" ${CANDIDATE_DIR}/${release_name}-*.tgz
  git add -A
  git commit -m "release v${release_version}"
fi

bosh2 create-release \
  --tarball ${FINAL_RELEASE_TARBALL}/${release_name}-${release_version}.tgz \
  ${RELEASE_YML}
{'fraction_non_alphanumeric': 0.1375961149332254, 'fraction_numerical': 0.003237555645487657, 'mean_word_length': 5.118811881188119, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '7363182', 'n_tokens_mistral': 915, 'n_tokens_neox': 874, 'n_words': 185}