<commit_before>#!/bin/bash

set -o errexit

if [[ ${#} -ne 2 ]]
then
  echo "Usage: ${0} [debian-package] [codename]" >&2
  exit 1
fi

PACKAGE=${1}
CODENAME=${2}
COMPONENT="main"

# Some validations
if [ -z "$S3_BUCKET" ]; then
  echo "Error: Missing ENV variable S3_BUCKET"
  exit 1
fi

if [ -z "$S3_ACCESS_KEY_ID" ]; then
  echo "Error: Missing ENV variable S3_ACCESS_KEY_ID"
  exit 1
fi

if [ -z "$S3_SECRET_ACCESS_KEY_ID" ]; then
  echo "Error: Missing ENV variable S3_SECRET_ACCESS_KEY_ID"
  exit 1
fi

echo "--- Uploading $PACKAGE to $S3_BUCKET ($CODENAME $COMPONENT)"

deb-s3 upload \
  --bucket $S3_BUCKET \
  --codename $CODENAME \
  --component $COMPONENT \
  --access-key-id=$S3_ACCESS_KEY_ID \
  --secret-access-key=$S3_SECRET_ACCESS_KEY_ID \
  $PACKAGE

echo "All done! To install:"
echo ""
echo "    # Add the repository to your APT sources"
echo "    $ echo deb $S3_BUCKET $CODENAME $COMPONENT > /etc/apt/sources.list.d/buildbox-agent.list"
echo ""
echo "    # Then import the repository key (TODO)"
echo "    $ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys xxx"
echo ""
echo "    # Install the agent"
echo "    $ apt-get update"
echo "    $ apt-get install -y buildbox-agent"<commit_msg>Changes to the ENV used to publish things.<commit_after>#!/bin/bash

set -o errexit

if [[ ${#} -ne 2 ]]
then
  echo "Usage: ${0} [debian-package] [codename]" >&2
  exit 1
fi

PACKAGE=${1}
CODENAME=${2}
COMPONENT="main"

# Some validations
if [ -z "$DEB_S3_BUCKET" ]; then
  echo "Error: Missing ENV variable DEB_S3_BUCKET"
  exit 1
fi

if [ -z "$DEB_S3_ACCESS_KEY_ID" ]; then
  echo "Error: Missing ENV variable DEB_S3_ACCESS_KEY_ID"
  exit 1
fi

if [ -z "$DEB_S3_SECRET_ACCESS_KEY_ID" ]; then
  echo "Error: Missing ENV variable DEB_S3_SECRET_ACCESS_KEY_ID"
  exit 1
fi

echo "--- Uploading $PACKAGE to $DEB_S3_BUCKET ($CODENAME $COMPONENT)"

deb-s3 upload \
  --bucket $DEB_S3_BUCKET \
  --codename $CODENAME \
  --component $COMPONENT \
  --access-key-id=$DEB_S3_ACCESS_KEY_ID \
  --secret-access-key=$DEB_S3_SECRET_ACCESS_KEY_ID \
  $PACKAGE

echo "✅ All done! To install:"
echo ""
echo "    # Add the repository to your APT sources"
echo "    $ echo deb $DEB_S3_BUCKET $CODENAME $COMPONENT > /etc/apt/sources.list.d/buildbox-agent.list"
echo ""
echo "    # Then import the repository key (TODO)"
echo "    $ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys xxx"
echo ""
echo "    # Install the agent"
echo "    $ apt-get update"
echo "    $ apt-get install -y buildbox-agent"
{'fraction_non_alphanumeric': 0.13804046013486712, 'fraction_numerical': 0.01824672748909163, 'mean_word_length': 3.5197132616487457, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2343368', 'n_tokens_mistral': 1045, 'n_tokens_neox': 1006, 'n_words': 263}