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

set -e

: ${STEMCELL_NAME:?}
: ${HEAVY_STEMCELL_NAME:?}

bosh_cli=$(realpath bosh-cli/bosh-cli-*)
chmod +x $bosh_cli
cp "${bosh_cli}" /usr/local/bin/bosh2

source director-state/director.env

pushd pipelines/aws/assets/e2e-test-release
  time bosh2 -n create-release --force --name e2e-test --version 1.0.0
  time bosh2 -n upload-release
popd

time bosh2 -n upload-stemcell "$(realpath stemcell/*.tgz)"
time bosh2 -n upload-stemcell "$(realpath heavy-stemcell/*.tgz)"

aws_kms_key_arn="$(echo environment/metadata | jq --raw-output ".aws_kms_key_arn")"

time bosh2 repack-stemcell \
  --name e2e-encrypted-heavy-stemcell \
  --version 0.1 \
  --cloud-properties "{\"encrypted\": true, \"kms_key_arn\": \"${aws_kms_key_arn}\"}" \
  "$(realpath heavy-stemcell/*.tgz)" \
  /tmp/e2e-encrypted-heavy-stemcell.tgz
time bosh2 -n upload-stemcell /tmp/e2e-encrypted-heavy-stemcell.tgz
encrypted_heavy_stemcell_ami_id="$( bosh2 stemcells | grep e2e-encrypted-heavy-stemcell | awk '{print $NF;}' )"

time bosh2 -n ucc \
  -l environment/metadata \
  pipelines/aws/assets/e2e-test-release/cloud-config-2.yml

time bosh2 -n deploy -d e2e-test \<commit_msg>environment/metadata is a file<commit_after>#!/usr/bin/env bash

set -e

: ${STEMCELL_NAME:?}
: ${HEAVY_STEMCELL_NAME:?}

bosh_cli=$(realpath bosh-cli/bosh-cli-*)
chmod +x $bosh_cli
cp "${bosh_cli}" /usr/local/bin/bosh2

source director-state/director.env

pushd pipelines/aws/assets/e2e-test-release
  time bosh2 -n create-release --force --name e2e-test --version 1.0.0
  time bosh2 -n upload-release
popd

time bosh2 -n upload-stemcell "$(realpath stemcell/*.tgz)"
time bosh2 -n upload-stemcell "$(realpath heavy-stemcell/*.tgz)"

aws_kms_key_arn="$(cat environment/metadata | jq --raw-output ".aws_kms_key_arn")"

time bosh2 repack-stemcell \
  --name e2e-encrypted-heavy-stemcell \
  --version 0.1 \
  --cloud-properties "{\"encrypted\": true, \"kms_key_arn\": \"${aws_kms_key_arn}\"}" \
  "$(realpath heavy-stemcell/*.tgz)" \
  /tmp/e2e-encrypted-heavy-stemcell.tgz
time bosh2 -n upload-stemcell /tmp/e2e-encrypted-heavy-stemcell.tgz
encrypted_heavy_stemcell_ami_id="$( bosh2 stemcells | grep e2e-encrypted-heavy-stemcell | awk '{print $NF;}' )"

time bosh2 -n ucc \
  -l environment/metadata \
  pipelines/aws/assets/e2e-test-release/cloud-config-2.yml

time bosh2 -n deploy -d e2e-test \
{'fraction_non_alphanumeric': 0.16385846672283066, 'fraction_numerical': 0.020219039595619208, 'mean_word_length': 3.917184265010352, 'pattern_counts': {'":': 4, '<': 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': '6094636', 'n_tokens_mistral': 1020, 'n_tokens_neox': 948, 'n_words': 183}