<commit_before>#!/bin/bash

set -ux

if [ $# -eq 0 ]; then
    mkdir -p $HOME/.aws
	cat <<EOF > $HOME/.aws/credentials
[default]
aws_access_key_id = $(cat /etc/secrets/aws-key)
aws_secret_access_key = $(cat /etc/secrets/aws-secret)
region = $(cat /etc/secrets/region)
EOF

	TAR=archive.tar
	WORKSPACE=/home/aftomato/workspace
	CONSOLE=/tmp/console.log

let START=$(date +%s)

	pushd $WORKSPACE

	/home/aftomato/buildscripts/build-scripts/${PROJECT_KEY}/build.sh 2>&1 | tee $CONSOLE
	BUILD_EXITCODE=${PIPESTATUS[0]}

	# todo what gets archived needs to be configurable
	tar czf /tmp/${TAR}.gz .

	popd

	gzip $CONSOLE

	let STOP=$(date +%s)
	DURATION=`expr $STOP - $START`

	aws s3 cp /tmp/${TAR}.gz s3://aftomato-build-artifacts/$BUILD_ID
	aws s3 cp ${CONSOLE}.gz s3://aftomato-console-logs/$BUILD_ID

	if [ $BUILD_EXITCODE -eq 0 ]; then
	     BUILD_STATUS="true"
	else
	     BUILD_STATUS="false"
	fi<commit_msg>fix build-scripts path<commit_after>#!/bin/bash

set -ux

if [ $# -eq 0 ]; then
    mkdir -p $HOME/.aws
	cat <<EOF > $HOME/.aws/credentials
[default]
aws_access_key_id = $(cat /etc/secrets/aws-key)
aws_secret_access_key = $(cat /etc/secrets/aws-secret)
region = $(cat /etc/secrets/region)
EOF

	TAR=archive.tar
	WORKSPACE=/home/aftomato/workspace
	CONSOLE=/tmp/console.log

let START=$(date +%s)

	pushd $WORKSPACE

	/home/aftomato/buildscripts/aftomato-build-scripts/${PROJECT_KEY}/build.sh 2>&1 | tee $CONSOLE
	BUILD_EXITCODE=${PIPESTATUS[0]}

	# todo what gets archived needs to be configurable
	tar czf /tmp/${TAR}.gz .

	popd

	gzip $CONSOLE

	let STOP=$(date +%s)
	DURATION=`expr $STOP - $START`

	aws s3 cp /tmp/${TAR}.gz s3://aftomato-build-artifacts/$BUILD_ID
	aws s3 cp ${CONSOLE}.gz s3://aftomato-console-logs/$BUILD_ID

	if [ $BUILD_EXITCODE -eq 0 ]; then
	     BUILD_STATUS="true"
	else
	     BUILD_STATUS="false"
	fi
{'fraction_non_alphanumeric': 0.15743756786102062, 'fraction_numerical': 0.009771986970684038, 'mean_word_length': 3.787012987012987, 'pattern_counts': {'":': 0, '<': 7, '<?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': '7186496', 'n_tokens_mistral': 781, 'n_tokens_neox': 740, 'n_words': 153}